Merge pull request #1304 from LachlanPond/master
Catch JDA exception when there is no internet connection
This commit is contained in:
@@ -34,6 +34,7 @@ import net.dv8tion.jda.api.*;
|
|||||||
import net.dv8tion.jda.api.entities.Activity;
|
import net.dv8tion.jda.api.entities.Activity;
|
||||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||||
import net.dv8tion.jda.api.utils.cache.CacheFlag;
|
import net.dv8tion.jda.api.utils.cache.CacheFlag;
|
||||||
|
import net.dv8tion.jda.api.exceptions.ErrorResponseException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -200,5 +201,11 @@ public class JMusicBot
|
|||||||
+ "invalid: " + ex + "\nConfig Location: " + config.getConfigLocation());
|
+ "invalid: " + ex + "\nConfig Location: " + config.getConfigLocation());
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
catch(ErrorResponseException ex)
|
||||||
|
{
|
||||||
|
prompt.alert(Prompt.Level.ERROR, "JMusicBot", ex + "\nInvalid reponse returned when "
|
||||||
|
+ "attempting to connect, please make sure you're connected to the internet");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user