From ff1619a62ff12727c1552ba9fe267b10dfd694a6 Mon Sep 17 00:00:00 2001 From: runebaas Date: Sun, 4 Feb 2018 14:47:10 +0100 Subject: [PATCH 1/3] Ignore error 50007 and 50013 --- Geekbot.net/Lib/ErrorHandler.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Geekbot.net/Lib/ErrorHandler.cs b/Geekbot.net/Lib/ErrorHandler.cs index 6cc6644..e6ea44e 100644 --- a/Geekbot.net/Lib/ErrorHandler.cs +++ b/Geekbot.net/Lib/ErrorHandler.cs @@ -42,6 +42,8 @@ namespace Geekbot.net.Lib { var errorString = errorMessage == "def" ? _translation.GetString(Context.Guild.Id, "errorHandler", "SomethingWentWrong") : errorMessage; var errorObj = SimpleConextConverter.ConvertContext(Context); + if (errorObj.Message.Content.Contains("50007")) return; + if (errorObj.Message.Content.Contains("50013")) return; _logger.Error("Geekbot", "An error ocured", e, errorObj); if (!string.IsNullOrEmpty(errorMessage)) { @@ -49,7 +51,7 @@ namespace Geekbot.net.Lib } if (_raven == null) return; - + var sentryEvent = new SentryEvent(e) { Tags = From 8d23420031aa6e27c7ea96131ee2bf5ef7a57d13 Mon Sep 17 00:00:00 2001 From: runebaas Date: Sun, 4 Feb 2018 14:52:30 +0100 Subject: [PATCH 2/3] Remove test warnings --- Tests/Lib/EmojiConverter.test.cs | 4 ++-- Tests/Lib/LevelCalc.test.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Lib/EmojiConverter.test.cs b/Tests/Lib/EmojiConverter.test.cs index bf41596..b9e7b4f 100644 --- a/Tests/Lib/EmojiConverter.test.cs +++ b/Tests/Lib/EmojiConverter.test.cs @@ -39,7 +39,7 @@ namespace Tests.Lib [Theory, MemberData(nameof(NumberToEmojiTestData))] - public async Task NumberToEmoji(int number, string expectedResult) + public void NumberToEmoji(int number, string expectedResult) { var emojiConverter = new EmojiConverter(); var result = emojiConverter.numberToEmoji(number); @@ -65,7 +65,7 @@ namespace Tests.Lib [Theory, MemberData(nameof(textToEmojiTestData))] - public async Task TextToEmoji(string text, string expectedResult) + public void TextToEmoji(string text, string expectedResult) { var emojiConverter = new EmojiConverter(); var result = emojiConverter.textToEmoji(text); diff --git a/Tests/Lib/LevelCalc.test.cs b/Tests/Lib/LevelCalc.test.cs index 74e6105..7c00392 100644 --- a/Tests/Lib/LevelCalc.test.cs +++ b/Tests/Lib/LevelCalc.test.cs @@ -39,7 +39,7 @@ namespace Tests.Lib [Theory, MemberData(nameof(LevelCalcTestData))] - public async Task GetLevel(int messages, int expectedResult) + public void GetLevel(int messages, int expectedResult) { var levelCalc = new LevelCalc(); var result = levelCalc.GetLevel(messages); From 46696549d77a2f17c9350f0d45716c6f0cb70471 Mon Sep 17 00:00:00 2001 From: runebaas Date: Sun, 4 Feb 2018 17:36:55 +0100 Subject: [PATCH 3/3] Check correct string to ignore errors *facepalm* --- Geekbot.net/Lib/ErrorHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Geekbot.net/Lib/ErrorHandler.cs b/Geekbot.net/Lib/ErrorHandler.cs index e6ea44e..bd82668 100644 --- a/Geekbot.net/Lib/ErrorHandler.cs +++ b/Geekbot.net/Lib/ErrorHandler.cs @@ -42,8 +42,8 @@ namespace Geekbot.net.Lib { var errorString = errorMessage == "def" ? _translation.GetString(Context.Guild.Id, "errorHandler", "SomethingWentWrong") : errorMessage; var errorObj = SimpleConextConverter.ConvertContext(Context); - if (errorObj.Message.Content.Contains("50007")) return; - if (errorObj.Message.Content.Contains("50013")) return; + if (e.Message.Contains("50007")) return; + if (e.Message.Contains("50013")) return; _logger.Error("Geekbot", "An error ocured", e, errorObj); if (!string.IsNullOrEmpty(errorMessage)) {