make it a library crate

This commit is contained in:
Sebastian Hugentobler 2024-05-09 08:58:45 +02:00
parent 93aeb80c56
commit 603c2fbe48
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
4 changed files with 75 additions and 71 deletions

View file

@ -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",