diff options
| author | acdenisSK <[email protected]> | 2017-08-01 06:53:46 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-08-01 06:53:46 +0200 |
| commit | 25d49316133e2a8b7c4b26d3b6a44efdf5ad8834 (patch) | |
| tree | 1a313f96374118bed3da5aeea5744106b9509c88 /src/error.rs | |
| parent | Remove the `ext` module and remove a match (diff) | |
| download | serenity-25d49316133e2a8b7c4b26d3b6a44efdf5ad8834.tar.xz serenity-25d49316133e2a8b7c4b26d3b6a44efdf5ad8834.zip | |
Provide the input and limit back to the user, and do some consistencies
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/error.rs b/src/error.rs index 185f907..508578b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -62,10 +62,11 @@ pub enum Error { /// An error occurred while parsing an integer. Num(ParseIntError), /// Input exceeded a limit. + /// Providing the input and the limit that's not supposed to be exceeded. /// /// *This only exists for the `GuildId::ban` and `Member::ban` functions. For their cases, /// it's the "reason".* - ExceededLimit, + ExceededLimit(String, u32), /// Some other error. This is only used for "Expected value <TYPE>" errors, /// when a more detailed error can not be easily provided via the /// [`Error::Decode`] variant. @@ -171,7 +172,7 @@ impl StdError for Error { fn description(&self) -> &str { match *self { Error::Decode(msg, _) | Error::Other(msg) => msg, - Error::ExceededLimit => "Input exceeded a limit", + Error::ExceededLimit(..) => "Input exceeded a limit", Error::Format(ref inner) => inner.description(), Error::Io(ref inner) => inner.description(), Error::Json(ref inner) => inner.description(), |