2020-06-20 19:22:19 +00:00
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
#[derive(Error, Debug)]
|
2020-01-05 22:15:43 +00:00
|
|
|
pub enum Error {
|
2020-06-20 19:22:19 +00:00
|
|
|
#[error("header size too small")]
|
2020-01-05 22:15:43 +00:00
|
|
|
HeaderSizeTooSmall,
|
2020-06-20 19:22:19 +00:00
|
|
|
#[error("invalid body type: {0}")]
|
2020-04-11 13:39:43 +00:00
|
|
|
InvalidBodyType(u8),
|
2020-06-20 19:22:19 +00:00
|
|
|
#[error("i/o")]
|
|
|
|
Io(#[from] async_std::io::Error),
|
|
|
|
#[error("json decoding")]
|
|
|
|
Json(#[from] serde_json::Error),
|
2020-01-05 22:15:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|