Added documentation for Error
This commit is contained in:
parent
56c90e454b
commit
df16b83b6e
1 changed files with 18 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
||||||
|
use std::borrow::Cow;
|
||||||
|
use std::fmt;
|
||||||
|
use std::fmt::{Display, Formatter};
|
||||||
|
|
||||||
|
/// Custom Error list for the library.
|
||||||
|
pub enum Error {
|
||||||
|
DiscordNotFound,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Display for Error {
|
||||||
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||||
|
let msg = match self {
|
||||||
|
Error::DiscordNotFound => Cow::Borrowed("Could not connect to client. Is Discord running ?"),
|
||||||
|
};
|
||||||
|
|
||||||
|
f.write_str(&msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue