Cleaned up event handler exceptions

This commit is contained in:
RogueException
2015-12-25 19:39:42 -04:00
parent 31bea1a394
commit 8609bad8ab

View File

@@ -99,7 +99,7 @@ namespace Discord
try { handler(this, eventArgs); } try { handler(this, eventArgs); }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Error($"{callerName.Substring(2)}'s handler encountered error {ex.GetType().Name}: ${ex.Message}", ex); Logger.Error($"{callerName.Substring(2)}'s handler encountered an error", ex);
} }
} }
private void OnEvent(EventHandler handler, [CallerMemberName] string callerName = null) private void OnEvent(EventHandler handler, [CallerMemberName] string callerName = null)
@@ -107,7 +107,7 @@ namespace Discord
try { handler(this, EventArgs.Empty); } try { handler(this, EventArgs.Empty); }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Error($"{callerName.Substring(2)}'s handler encountered error {ex.GetType().Name}: ${ex.Message}", ex); Logger.Error($"{callerName.Substring(2)}'s handler encountered an error", ex);
} }
} }
} }