Migrate from derive_more to thiserror

This commit is contained in:
Lennart
2024-09-19 15:38:57 +02:00
parent 436d6fd41c
commit 8e11e1aa0d
5 changed files with 8 additions and 11 deletions

View File

@@ -6,7 +6,6 @@ edition = "2021"
[dependencies]
actix-web = "4.9"
actix-web-httpauth = "0.8"
derive_more = "1.0"
futures-util = "0.3"
password-auth = "1.0"
serde = { version = "1.0", features = ["derive"] }

View File

@@ -1,15 +1,15 @@
use actix_web::{http::StatusCode, HttpResponse};
use derive_more::Display;
use thiserror::Error;
#[derive(Debug, Display, Error, Clone)]
#[derive(Debug, Error, Clone)]
pub enum Error {
#[display("Internal server error")]
#[error("Internal server error")]
InternalError,
#[display("Not found")]
#[error("Not found")]
NotFound,
#[display("Bad request")]
#[error("Bad request")]
BadRequest,
#[error("Unauthorized")]
Unauthorized,
}