Skip to content

Commit

Permalink
feat: add variant to error
Browse files Browse the repository at this point in the history
  • Loading branch information
vidhanio committed Dec 4, 2023
1 parent 02d0604 commit ee34fea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ members = [".", "macros"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/vidhanio/serenity-commands"
version = "0.1.0"
version = "0.2.0"

[workspace.dependencies]
serenity-commands-macros = { version = "0.1", path = "macros" }
serenity-commands-macros = { version = "0.2", path = "macros" }

serenity = { version = "0.12", default-features = false, features = [
"builder",
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;

/// An error which can occur when extracting data from a command interaction.
#[derive(Debug, Clone, Error)]
#[derive(Debug, Error)]
pub enum Error {
/// An unknown command was provided.
#[error("unknown command: {0}")]
Expand Down Expand Up @@ -280,6 +280,10 @@ pub enum Error {
/// A required command option was not provided.
#[error("required command option not provided")]
MissingRequiredCommandOption,

/// An error occurred within a custom implementation.
#[error(transparent)]
Custom(#[from] Box<dyn std::error::Error + Send + Sync>),
}

/// A top-level utility structure which can list all of its commands (for use
Expand Down

0 comments on commit ee34fea

Please sign in to comment.