Update and Migrate Diesel to 2.0
Almost have tag support working, still figuring out how to get photo tags.
This commit is contained in:
1 parent
40c79d13db
commit
68bfcbf85f
8 files changed
+1009
-586
No files matched your search
@@ -0,0 +1,14 @@
|
||||
use actix_web::{error::InternalError, http::StatusCode};
|
||||
|
||||
pub trait IntoHttpError<T> {
|
||||
fn into_http_internal_err(self) -> Result<T, actix_web::Error>;
|
||||
}
|
||||
|
||||
impl<T> IntoHttpError<T> for Result<T, anyhow::Error> {
|
||||
fn into_http_internal_err(self) -> Result<T, actix_web::Error> {
|
||||
self.map_err(|e| {
|
||||
log::error!("Map to err: {:?}", e);
|
||||
InternalError::new(e, StatusCode::INTERNAL_SERVER_ERROR).into()
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user