poa-bridge/bridge/src/error.rs

33 lines
699 B
Rust
Raw Normal View History

2017-08-13 04:09:50 -07:00
#![allow(unknown_lints)]
use std::io;
2017-08-12 01:55:18 -07:00
use tokio_timer::TimerError;
use {web3, toml, ethabi};
2017-06-25 04:21:13 -07:00
2017-08-02 03:45:15 -07:00
error_chain! {
types {
Error, ErrorKind, ResultExt, Result;
2017-06-25 04:21:13 -07:00
}
2017-08-02 03:45:15 -07:00
foreign_links {
Io(io::Error);
Toml(toml::de::Error);
2017-08-10 08:55:46 -07:00
Ethabi(ethabi::Error);
2017-08-12 01:55:18 -07:00
Timer(TimerError);
2017-06-25 04:21:13 -07:00
}
2017-08-01 02:36:48 -07:00
2017-08-02 03:45:15 -07:00
errors {
2017-08-04 08:57:09 -07:00
// workaround for error_chain not allowing to check internal error kind
// https://github.com/rust-lang-nursery/error-chain/issues/206
MissingFile(filename: String) {
description("File not found"),
display("File {} not found", filename),
}
2017-08-02 03:45:15 -07:00
// workaround for lack of web3:Error Display and Error implementations
Web3(err: web3::Error) {
2017-08-04 08:57:09 -07:00
description("web3 error"),
display("{:?}", err),
2017-08-02 03:45:15 -07:00
}
2017-08-01 02:36:48 -07:00
}
}