pub enum AppError {
Show 34 variants
NotFound,
Gone,
Forbidden,
Conflict,
FileEmpty,
FilenameEmpty,
FilenameTooLong,
InvalidFilename,
GzipDecodeFailed,
InvalidTtlValue,
TtlTooLow,
TtlTooHigh,
MissingFileField,
PublicUrlNotConfigured,
InvalidIdFormat,
TusMissingLength,
TusMissingOffset,
TusOffsetMismatch,
TusSessionNotFound,
TusStagingError,
PayloadTooLarge,
RateLimited,
JuicehostUnreachable(String),
JuicehostRejected(String),
InsufficientStorage(String),
JuicehostDeleteFailed(String),
JuicehostRenameFailed(String),
FilesystemError(Error),
DatabaseError(Error),
DbPoolError(String),
TaskPanicked(String),
BadRequest(String),
InvalidMultipart(String),
Internal(String),
}Expand description
Every error the app can return. Each variant maps to an HTTP status code and a JSON body with an error code and a message.
Variants§
NotFound
Gone
Forbidden
Conflict
FileEmpty
File payload is empty (0 bytes after decompression)
FilenameEmpty
Filename is empty after sanitisation
FilenameTooLong
Original filename exceeds 255 characters
InvalidFilename
Filename contains invalid characters (sanitised away entirely)
GzipDecodeFailed
Upload body claims gzip but decompression failed
InvalidTtlValue
TTL value could not be parsed from the request
TtlTooLow
TTL is below the minimum allowed
TtlTooHigh
TTL is above the maximum allowed
MissingFileField
No file field was present in the multipart upload
PublicUrlNotConfigured
The public_base_url config is empty and a URL cannot be generated
InvalidIdFormat
File ID contains invalid characters
TusMissingLength
Upload-Length header missing or unparseable
TusMissingOffset
Upload-Offset header missing or unparseable
TusOffsetMismatch
Client-supplied offset does not match server state
TusSessionNotFound
TUS upload session not found
TusStagingError
Failed to create the staging file for a new TUS upload
PayloadTooLarge
RateLimited
JuicehostUnreachable(String)
Cannot reach juicehost at all (connection refused / dns)
JuicehostRejected(String)
juicehost returned a non-2xx status
InsufficientStorage(String)
juicehost returned 507, disk is full
JuicehostDeleteFailed(String)
juicehost delete returned an error
JuicehostRenameFailed(String)
juicehost rename returned an error
FilesystemError(Error)
DatabaseError(Error)
DbPoolError(String)
Could not acquire a connection from the database pool
TaskPanicked(String)
A background task (spawn_blocking) panicked