summaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-05 06:04:52 -0500
committerseth <[email protected]>2023-12-15 16:41:13 -0500
commiteacf266d22ddf03541524755a43c8c46ed4cd4cb (patch)
treeca3d7d4a127ef53b6a4f15776d00e0243e54a3be /src/handlers
parent815cb0df3b3e3f9dd2078b00f85754da87b1d55e (diff)
feat: handle errors during setup
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/error.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/handlers/error.rs b/src/handlers/error.rs
index b5b259d..c6cefa2 100644
--- a/src/handlers/error.rs
+++ b/src/handlers/error.rs
@@ -8,7 +8,14 @@ use poise::FrameworkError;
pub async fn handle(error: poise::FrameworkError<'_, Data, Report>) {
match error {
- FrameworkError::Setup { error, .. } => error!("Error setting up client!\n{error:#?}"),
+ FrameworkError::Setup {
+ error, framework, ..
+ } => {
+ error!("Error setting up client! Bailing out");
+ framework.shard_manager().lock().await.shutdown_all().await;
+
+ panic!("{error}")
+ }
FrameworkError::Command { error, ctx } => {
error!("Error in command {}:\n{error:?}", ctx.command().name);