Merge pull request #69 from jjw24/fix_error_message

Fix error message logging for prod run
This commit is contained in:
Jeremy Wu 2019-11-08 05:39:06 +11:00 committed by GitHub
commit 6a664d976f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -41,7 +41,8 @@ namespace Wox.Plugin.Program.Logger
} }
/// <summary> /// <summary>
/// Please follow exception format: |class name|calling method name|loading program path|user friendly message that explains the error /// Please follow exception format, there are four parts to an error message that need to be specified:
/// |class name|calling method name|loading program path|user friendly message that explains the error
/// => Example: |Win32|LnkProgram|c:\..\chrome.exe|Permission denied on directory, but Wox should continue /// => Example: |Win32|LnkProgram|c:\..\chrome.exe|Permission denied on directory, but Wox should continue
/// </summary> /// </summary>
[MethodImpl(MethodImplOptions.Synchronized)] [MethodImpl(MethodImplOptions.Synchronized)]

View File

@ -159,15 +159,15 @@ namespace Wox.Plugin.Program.Programs
#if !DEBUG #if !DEBUG
catch (Exception e) catch (Exception e)
{ {
ProgramLogger.LogException("|UWP|All|An unexpected error occured and " ProgramLogger.LogException($"|UWP|All|{p.InstalledLocation}|An unexpected error occured and "
+ $"unable to convert Package to UWP for {p.Id.FullName}", e); + $"unable to convert Package to UWP for {p.Id.FullName}", e);
return new Application[] { }; return new Application[] { };
} }
#endif #endif
#if DEBUG //make developer aware and implement handling #if DEBUG //make developer aware and implement handling
catch(Exception) catch(Exception e)
{ {
throw; throw e;
} }
#endif #endif
return u.Apps; return u.Apps;
@ -207,7 +207,7 @@ namespace Wox.Plugin.Program.Programs
} }
catch (Exception e) catch (Exception e)
{ {
ProgramLogger.LogException("|UWP|CurrentUserPackages|An unexpected error occured and " ProgramLogger.LogException("|UWP|CurrentUserPackages|Not available|An unexpected error occured and "
+ $"unable to verify if package is valid", e); + $"unable to verify if package is valid", e);
return false; return false;
} }