mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
create error module for services
This commit is contained in:
20
src/service/error.rs
Normal file
20
src/service/error.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use std::fmt;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, ServicesError>;
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub enum ServicesError {
|
||||
ResonseError(&'static str),
|
||||
}
|
||||
|
||||
impl std::error::Error for ServicesError {}
|
||||
|
||||
impl fmt::Display for ServicesError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result {
|
||||
match *self {
|
||||
ServicesError::ResonseError(ref err) => write!(f, "Response: {}", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user