Improve exception handling
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-01-15 05:00:44 +01:00
parent d2abeb35fc
commit ee4c5155fa
3 changed files with 15 additions and 3 deletions

View File

@@ -77,7 +77,12 @@ public class HidekoBot
);
jda = jdaBuilder.build().awaitReady();
} catch (Exception e)
} catch (InterruptedException e) {
LOGGER.error(e.getMessage()); // print the error message, omit the stack trace.
Thread.currentThread().interrupt(); // send interrupt to the thread.
shutdown(); // if we failed connecting and authenticating, then quit.
}
catch (Exception e)
{
LOGGER.error(e.getMessage()); // print the error message, omit the stack trace.
shutdown(); // if we failed connecting and authenticating, then quit.