darkwing::server::error

Enum Error

source
pub enum Error {
Show 33 variants Unauthorized, PaymentRequired, Forbidden, PlanDoesNotAllowAccess, NotFound(String), ApplicationStartup(String), BadRequest(String), InternalServerError, InternalServerErrorWithContext(String), ObjectConflict(String), UnprocessableEntity { errors: ErrorMap, }, Validation(ValidationErrors), AxumJsonRejection(JsonRejection), AnyhowError(Error), AesGcmError, ConfigForming(String), DatabaseParsing(String), StdIO(Error), Zip(ZipError), Rusqlite(Error), S3(Error), S3Client(SdkError<GetObjectError>), S3GetObject(GetObjectError), BaseFileHashMismatch, ResultingFileHashMismatch, Diff(String), SerdeJson(Error), NoPreviousDatadir, UnknownMode(String), TimeFormatDescription(InvalidFormatDescription), TimeFormat(Format), UnknownOverrideMode(String), DatabaseDecoding(String, String),
}
Expand description

The main error enum for the application.

This enum covers all possible error cases that can occur in the application, from authentication failures to database errors and file processing issues.

Variants§

§

Unauthorized

Authentication is required but not provided

§

PaymentRequired

Payment is required to access the resource

§

Forbidden

User lacks necessary permissions

§

PlanDoesNotAllowAccess

User’s plan doesn’t allow access

§

NotFound(String)

Resource not found

Tuple Fields

§0: String

Description of what resource was not found

§

ApplicationStartup(String)

Application startup error

Tuple Fields

§0: String

Description of what went wrong during startup

§

BadRequest(String)

Bad request error with context

Tuple Fields

§0: String

Description of why the request was invalid

§

InternalServerError

Generic internal server error

§

InternalServerErrorWithContext(String)

Internal server error with context

Tuple Fields

§0: String

Description of what went wrong internally

§

ObjectConflict(String)

Object conflict error

Tuple Fields

§0: String

Description of the conflicting object state

§

UnprocessableEntity

Unprocessable entity with validation errors

Fields

§errors: ErrorMap

Map of field names to validation error messages

§

Validation(ValidationErrors)

Validation error from the validator crate

Tuple Fields

§0: ValidationErrors

The underlying validation errors

§

AxumJsonRejection(JsonRejection)

JSON parsing rejection from Axum

Tuple Fields

§0: JsonRejection

The underlying Axum JSON rejection error

§

AnyhowError(Error)

Generic error type for wrapping any error

Tuple Fields

§0: Error

The underlying error being wrapped

§

AesGcmError

Error while encrypting config

§

ConfigForming(String)

Error while forming config

Tuple Fields

§0: String

Description of what went wrong during config formation

§

DatabaseParsing(String)

Error while parsing database values to Rust types

Tuple Fields

§0: String

Description of what went wrong during database parsing

§

StdIO(Error)

Standard IO error

Tuple Fields

§0: Error

The underlying IO error

§

Zip(ZipError)

Zip error

Tuple Fields

§0: ZipError

The underlying zip error

§

Rusqlite(Error)

Rusqlite error

Tuple Fields

§0: Error

The underlying SQLite error

§

S3(Error)

S3 error

Tuple Fields

§0: Error

The underlying S3 error

§

S3Client(SdkError<GetObjectError>)

S3 client error

Tuple Fields

§0: SdkError<GetObjectError>

The underlying S3 client error

§

S3GetObject(GetObjectError)

S3 GetObjectError

Tuple Fields

§0: GetObjectError

The underlying S3 GetObject error

§

BaseFileHashMismatch

Base file hash does not match

§

ResultingFileHashMismatch

Resulting file hash does not match

§

Diff(String)

Diff error

Tuple Fields

§0: String

Description of what went wrong during diffing

§

SerdeJson(Error)

SerdeJson error

Tuple Fields

§0: Error

The underlying Serde JSON error

§

NoPreviousDatadir

No previous datadir, send full zip

§

UnknownMode(String)

Unknown mode

Tuple Fields

§0: String

The invalid mode that was provided

§

TimeFormatDescription(InvalidFormatDescription)

Time format description error

Tuple Fields

§0: InvalidFormatDescription

The underlying time format description error

§

TimeFormat(Format)

Time format error

Tuple Fields

§0: Format

The underlying time format error

§

UnknownOverrideMode(String)

Unknown override mode

Tuple Fields

§0: String

The invalid override mode that was provided

§

DatabaseDecoding(String, String)

Error while decoding field from database

Tuple Fields

§0: String

The name of the field that failed to decode

§1: String

Description of what went wrong during decoding

Implementations§

source§

impl Error

source

pub fn unprocessable_entity(errors: ValidationErrors) -> Response

Maps validator’s ValidationErrors to a simple map of property name/error messages structure.

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Self

Converts to this type from the input type.
source§

impl From<Format> for Error

source§

fn from(source: Format) -> Self

Converts to this type from the input type.
source§

impl From<GetObjectError> for Error

source§

fn from(source: GetObjectError) -> Self

Converts to this type from the input type.
source§

impl From<InvalidFormatDescription> for Error

source§

fn from(source: InvalidFormatDescription) -> Self

Converts to this type from the input type.
source§

impl From<JsonRejection> for Error

source§

fn from(source: JsonRejection) -> Self

Converts to this type from the input type.
source§

impl From<SdkError<GetObjectError, Response>> for Error

source§

fn from(source: SdkError<GetObjectError>) -> Self

Converts to this type from the input type.
source§

impl From<ValidationErrors> for Error

source§

fn from(source: ValidationErrors) -> Self

Converts to this type from the input type.
source§

impl From<ZipError> for Error

source§

fn from(source: ZipError) -> Self

Converts to this type from the input type.
source§

impl IntoResponse for Error

source§

fn into_response(self) -> Response

Create a response.

Auto Trait Implementations§

§

impl !Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ValidateIp for T
where T: ToString,

§

fn validate_ipv4(&self) -> bool

Validates whether the given string is an IP V4
§

fn validate_ipv6(&self) -> bool

Validates whether the given string is an IP V6
§

fn validate_ip(&self) -> bool

Validates whether the given string is an IP
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more