use std::error::Error as StdError;
use std::fmt;
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Error {
NotSupported,
IncompatiblePathCharset,
ObjcCallFailed,
SystemCallFailed,
}
impl StdError for Error {
fn description(&self) -> &str {
match *self {
Error::IncompatiblePathCharset => "path can't be converted to UTF-8 C str",
Error::ObjcCallFailed => "error while calling basic objc functions",
Error::SystemCallFailed => "unable to exclude the path",
Error::NotSupported => "excluding not supported on this platform",
}
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}