From ecdc744769aa0d24b083db9603d15bbd1d783157 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 30 Sep 2016 17:24:25 +0200 Subject: [PATCH] A bit better logging of errors in commandhandler --- src/NadekoBot/Services/CommandHandler.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/NadekoBot/Services/CommandHandler.cs b/src/NadekoBot/Services/CommandHandler.cs index 0a7f6372..75f43088 100644 --- a/src/NadekoBot/Services/CommandHandler.cs +++ b/src/NadekoBot/Services/CommandHandler.cs @@ -101,17 +101,11 @@ namespace NadekoBot.Services } } } - catch (InvalidOperationException ex) + catch (Exception ex) { - Console.WriteLine(ex); - } - catch (SqliteException ex) - { - Console.WriteLine(ex.InnerException); - } - catch (HttpException ex) - { - Console.WriteLine(ex); + _log.Warn(ex, "Error in CommandHandler"); + if(ex.InnerException != null) + _log.Warn(ex.InnerException, "Inner Exception of the error in CommandHandler"); } });