diff options
author | Cara Salter <cara@devcara.com> | 2022-05-03 13:57:09 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-05-03 13:57:09 -0400 |
commit | 5999e6a803a7b848acf054918fec9ee5024d5697 (patch) | |
tree | eae1f3986c41f7d7c1a956e4606a8120c6032e05 /src/errors.rs | |
parent | 8f4277c55a2079edf1c9a69383c353e1cb9ef55c (diff) | |
download | glitch-ng-5999e6a803a7b848acf054918fec9ee5024d5697.tar.gz glitch-ng-5999e6a803a7b848acf054918fec9ee5024d5697.zip |
filter: Initial message filter implementation
Also a custom error type, tracing_subscriber, and unsafe impls
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 21 |
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 { } + |