aboutsummaryrefslogtreecommitdiff
path: root/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs
new file mode 100644
index 0000000..6e78011
--- /dev/null
+++ b/src/errors.rs
@@ -0,0 +1,21 @@
+use poise::FrameworkError;
+
+
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ #[error("Serenity: {0}")]
+ Serenity(#[from] serenity::prelude::SerenityError),
+
+ #[error("SQL: {0}")]
+ Sql(#[from] sqlx::Error),
+
+ #[error("Unknown: {0}")]
+ Unknown(String),
+
+ #[error("Catch-all: {0}")]
+ CatchAll(#[from] Box<dyn std::error::Error>),
+}
+
+unsafe impl Send for Error { }
+unsafe impl Sync for Error { }
+