make it a library crate
This commit is contained in:
parent
93aeb80c56
commit
603c2fbe48
4 changed files with 75 additions and 71 deletions
|
@ -18,7 +18,7 @@ pub enum HandlerError {
|
|||
impl ResponseError for HandlerError {
|
||||
fn status(&self) -> StatusCode {
|
||||
match &self {
|
||||
HandlerError::OpdsError(e) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
HandlerError::OpdsError(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
HandlerError::DataError(e) => match e {
|
||||
DataStoreError::NoResults(_) => StatusCode::NOT_FOUND,
|
||||
_ => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
|
@ -30,7 +30,7 @@ impl ResponseError for HandlerError {
|
|||
let id = Uuid::new_v4();
|
||||
let internal_msg = format!("{:?}", self);
|
||||
let external_msg = match &self {
|
||||
HandlerError::OpdsError(e) => "internal server error",
|
||||
HandlerError::OpdsError(_) => "internal server error",
|
||||
HandlerError::DataError(e) => match e {
|
||||
DataStoreError::NoResults(_) => "item not found",
|
||||
_ => "internal server error",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue