From bd55e3670a278cda1ecea2b1dddad30d3e550672 Mon Sep 17 00:00:00 2001 From: Mazawrath Date: Tue, 14 Jan 2020 18:23:49 -0500 Subject: [PATCH] Added Sentry logging to crashes --- .../beanbot/commands/beancoin/BeanTriviaCommand.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/mazawrath/beanbot/commands/beancoin/BeanTriviaCommand.java b/src/main/java/com/mazawrath/beanbot/commands/beancoin/BeanTriviaCommand.java index 0dde1f5..24377be 100644 --- a/src/main/java/com/mazawrath/beanbot/commands/beancoin/BeanTriviaCommand.java +++ b/src/main/java/com/mazawrath/beanbot/commands/beancoin/BeanTriviaCommand.java @@ -163,14 +163,15 @@ public void onCommand(ServerTextChannel serverTextChannel, DiscordApi api, User winnersMessage.append("The correct answer was: ").append(correctAnswer).append(".\nAnyone who answered correctly received ").append(Points.pointsToString(Points.TRIVIA_CORRECT_ANSWER)).append("."); serverTextChannel.sendMessage(winnersMessage.toString()); - } catch (InterruptedException e) { - e.printStackTrace(); - } catch (ExecutionException e) { + } catch (Exception e) { e.printStackTrace(); + Sentry.capture(e); + serverTextChannel.sendMessage("Attempted to send trivia message but failed."); } }).start(); } catch (Exception e) { serverTextChannel.sendMessage("Attempted to send trivia message but failed."); + Sentry.capture(e); return; } } else {