Can download a copy of storage
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-11-19 20:38:19 +01:00
parent 9fcd16784a
commit bb0226577d
11 changed files with 305 additions and 3 deletions

View File

@ -4,6 +4,7 @@ use actix_web::HttpResponse;
use std::error::Error;
use std::fmt::{Display, Formatter};
use std::io::ErrorKind;
use zip::result::ZipError;
/// Custom error to ease controller writing
#[derive(Debug)]
@ -109,6 +110,18 @@ impl From<openssl::error::ErrorStack> for HttpErr {
}
}
impl From<ZipError> for HttpErr {
fn from(value: ZipError) -> Self {
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into())
}
}
impl From<walkdir::Error> for HttpErr {
fn from(value: walkdir::Error) -> Self {
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into())
}
}
impl From<HttpResponse> for HttpErr {
fn from(value: HttpResponse) -> Self {
HttpErr::HTTPResponse(value)