mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 07:02:24 +00:00
Replace more anyhow errors with explicit error types
This commit is contained in:
@@ -2,7 +2,6 @@ use crate::CalDavContext;
|
||||
use crate::Error;
|
||||
use actix_web::web::{Data, Path};
|
||||
use actix_web::HttpResponse;
|
||||
use anyhow::Result;
|
||||
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
|
||||
use rustical_store::calendar::Calendar;
|
||||
use rustical_store::CalendarStore;
|
||||
|
||||
@@ -29,6 +29,7 @@ impl actix_web::ResponseError for Error {
|
||||
match self {
|
||||
Error::StoreError(err) => match err {
|
||||
rustical_store::Error::NotFound => StatusCode::NOT_FOUND,
|
||||
rustical_store::Error::InvalidIcs(_) => StatusCode::BAD_REQUEST,
|
||||
_ => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
},
|
||||
Error::DavError(err) => err.status_code(),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use crate::Error;
|
||||
use actix_web::HttpRequest;
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use rustical_auth::AuthInfo;
|
||||
use rustical_dav::resource::{Resource, ResourceService};
|
||||
|
||||
Reference in New Issue
Block a user