From ae0ba3d2ee6eb76fd3f2390f9a5f425c636d8d92 Mon Sep 17 00:00:00 2001 From: derco0n Date: Wed, 27 Apr 2022 11:14:08 +0200 Subject: [PATCH] removed unneeded try-catch while writing to file in C_LoggingHelper --- Co0nUtilZ/C_LoggingHelper.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Co0nUtilZ/C_LoggingHelper.cs b/Co0nUtilZ/C_LoggingHelper.cs index 2df1dcd..8700308 100644 --- a/Co0nUtilZ/C_LoggingHelper.cs +++ b/Co0nUtilZ/C_LoggingHelper.cs @@ -161,19 +161,11 @@ private bool TryWriteLog(String msg, EventLogEntryType Type, UInt16 Messagenumbe { //An error occured while writing to the event-log if (this._OnErrorLogToFile) { //as OnErrorlogtoFile is set, we write log and error down to a file within user's appdata\roaming - try - { string prefix = "coonutils_logexceptions"; string targetfile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "logs", prefix, "logerror_" + String.Format("{0:yyyyMMdd_HH-mm-ss}", DateTime.Now) + "_" + Assembly.GetEntryAssembly().GetName().Name); msg="The following error occured while logging to eventlog -> " + ex.Message + "\r\n\r\nStacktrace:\r\n" + ex.StackTrace + "\r\n\r\n Dumping original logmessage below:\r\n" + msg; this.logtofile(targetfile, msg, 30, prefix); - } - catch - { - //giving up, as text file can't be written either - } - } return false; //as we were unable to write to the eventlog, return false... }