mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 02:22:21 +00:00
Migrate from derive_more to thiserror
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1952,7 +1952,6 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"actix-web-httpauth",
|
"actix-web-httpauth",
|
||||||
"derive_more 1.0.0",
|
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"password-auth",
|
"password-auth",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -2010,7 +2009,6 @@ dependencies = [
|
|||||||
"actix-web",
|
"actix-web",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"derive_more 1.0.0",
|
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"itertools",
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "4.9"
|
actix-web = "4.9"
|
||||||
actix-web-httpauth = "0.8"
|
actix-web-httpauth = "0.8"
|
||||||
derive_more = "1.0"
|
|
||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
password-auth = "1.0"
|
password-auth = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
use actix_web::{http::StatusCode, HttpResponse};
|
use actix_web::{http::StatusCode, HttpResponse};
|
||||||
use derive_more::Display;
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Debug, Display, Error, Clone)]
|
#[derive(Debug, Error, Clone)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[display("Internal server error")]
|
#[error("Internal server error")]
|
||||||
InternalError,
|
InternalError,
|
||||||
#[display("Not found")]
|
#[error("Not found")]
|
||||||
NotFound,
|
NotFound,
|
||||||
#[display("Bad request")]
|
#[error("Bad request")]
|
||||||
BadRequest,
|
BadRequest,
|
||||||
|
#[error("Unauthorized")]
|
||||||
Unauthorized,
|
Unauthorized,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ edition = "2021"
|
|||||||
actix-web = "4.9"
|
actix-web = "4.9"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
derive_more = "1.0"
|
|
||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
quick-xml = { version = "0.36", features = [
|
quick-xml = { version = "0.36", features = [
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
use actix_web::{http::StatusCode, FromRequest, HttpRequest, ResponseError};
|
use actix_web::{http::StatusCode, FromRequest, HttpRequest, ResponseError};
|
||||||
use derive_more::Display;
|
|
||||||
use futures_util::future::{err, ok, Ready};
|
use futures_util::future::{err, ok, Ready};
|
||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Debug, Display)]
|
#[derive(Error, Debug)]
|
||||||
|
#[error("Invalid Depth header")]
|
||||||
pub struct InvalidDepthHeader {}
|
pub struct InvalidDepthHeader {}
|
||||||
|
|
||||||
impl ResponseError for InvalidDepthHeader {
|
impl ResponseError for InvalidDepthHeader {
|
||||||
|
|||||||
Reference in New Issue
Block a user