-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from dsietz/development
Issue #17
- Loading branch information
Showing
6 changed files
with
455 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! Data Tracker Chain specific Errors | ||
|
||
use std::error; | ||
use derive_more::Display; | ||
use actix_web::ResponseError; | ||
|
||
#[derive(Debug, Clone, Display)] | ||
pub enum Error { | ||
/// Bad Data Uasage Agreement | ||
#[display(fmt = "Invalid or Currupt Marker")] | ||
BadMarker, | ||
/// Bad format of Data Uasage Agreement | ||
#[display(fmt = "Invalid Marker Chain")] | ||
BadChain, | ||
} | ||
|
||
impl error::Error for Error{} | ||
|
||
impl ResponseError for Error{} | ||
|
||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn test_error_marker_bad() { | ||
let err = Error::BadMarker; | ||
assert_eq!(format!("{}", err), "Invalid or Currupt Marker"); | ||
} | ||
|
||
#[test] | ||
fn test_error_chain_bad() { | ||
let err = Error::BadChain; | ||
assert_eq!(format!("{}", err), "Invalid Marker Chain"); | ||
} | ||
} |
Oops, something went wrong.