From 5999e6a803a7b848acf054918fec9ee5024d5697 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Tue, 3 May 2022 13:57:09 -0400 Subject: filter: Initial message filter implementation Also a custom error type, tracing_subscriber, and unsafe impls --- src/errors.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/errors.rs (limited to 'src/errors.rs') 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), +} + +unsafe impl Send for Error { } +unsafe impl Sync for Error { } + -- cgit v1.2.3