diff --git a/src/models/error.rs b/src/models/error.rs index e69de29..ef280a6 100644 --- a/src/models/error.rs +++ b/src/models/error.rs @@ -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) + } +}