Open f0o opened 3 years ago
0.28s user 0.17s system 0% cpu 30:09.96 total
After 30m I decided to just ^C
it..
diff --git a/src/main/java/com/shimmermare/inviteroles/InviteRoles.java b/src/main/java/com/shimmermare/inviteroles/InviteRoles.java
index e9fcd3f..6e2c906 100644
--- a/src/main/java/com/shimmermare/inviteroles/InviteRoles.java
+++ b/src/main/java/com/shimmermare/inviteroles/InviteRoles.java
@@ -110,7 +110,7 @@ public class InviteRoles
catch (LoginException e)
{
LOGGER.error("Unable to login to Discord", e);
- return;
+ System.exit(-1);
}
try
@@ -120,7 +120,7 @@ public class InviteRoles
catch (InterruptedException e)
{
LOGGER.error("Failed to await JDA ready", e);
- return;
+ System.exit(-1);
}
User selfUser = jda.getSelfUser();
fixes it
A proper fix would be to try-catch the shutdown() function. However the whole logic of the codepaths are very off in my opinion.
It should not be considered running until the login succeeded and jda returns ready which means the whole run()
function should be placed somewhere else and allow for an early exit.
Executing the application without any valid parameters will leave the application in an error state and not exit.
From this point forward the application still runs but isn't doing anything. It would be a lot better if it would just exit and post a non-zero exit code.