unabletovalidateclass
This commit is contained in:
parent
edef831813
commit
24b63f1a75
3 changed files with 9 additions and 0 deletions
|
|
@ -2,6 +2,11 @@ use eva::{bytesize::ByteSize, data};
|
||||||
|
|
||||||
use crate::types::{file, upload};
|
use crate::types::{file, upload};
|
||||||
|
|
||||||
|
#[data(error, display("unable to validate file class: {error}"))]
|
||||||
|
pub struct UnableToValidateClass {
|
||||||
|
pub error: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[data(error, copy, display("someone is finishing file already"))]
|
#[data(error, copy, display("someone is finishing file already"))]
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub enum ConcurrentUploadInProgress {
|
pub enum ConcurrentUploadInProgress {
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,8 @@ pub mod finish {
|
||||||
|
|
||||||
#[data(error)]
|
#[data(error)]
|
||||||
pub enum Err {
|
pub enum Err {
|
||||||
|
#[display("{_0}")]
|
||||||
|
UnableToValidateClass(#[from] errors::uploads::UnableToValidateClass),
|
||||||
#[display("{_0}")]
|
#[display("{_0}")]
|
||||||
NotFound(#[from] errors::uploads::NotFound),
|
NotFound(#[from] errors::uploads::NotFound),
|
||||||
#[display("{_0}")]
|
#[display("{_0}")]
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ status_code::map!(reqs::finish::Err => [
|
||||||
NotFound,
|
NotFound,
|
||||||
Overuploading,
|
Overuploading,
|
||||||
ConcurrentUploadInProgress,
|
ConcurrentUploadInProgress,
|
||||||
|
UnableToValidateClass,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
#[data]
|
#[data]
|
||||||
|
|
@ -54,4 +55,5 @@ const _: () = {
|
||||||
direct!(SimUpQuotaExceeded => TOO_MANY_REQUESTS);
|
direct!(SimUpQuotaExceeded => TOO_MANY_REQUESTS);
|
||||||
direct!(Overuploading => BAD_REQUEST);
|
direct!(Overuploading => BAD_REQUEST);
|
||||||
direct!(HashMismatch => BAD_REQUEST);
|
direct!(HashMismatch => BAD_REQUEST);
|
||||||
|
direct!(UnableToValidateClass => BAD_REQUEST);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue