errors/errors library

Classes

AppError
Abstract base class for all application errors.
AppUnknownError
An unexpected or unclassified application error.
CacheError
Abstract base for cache-related errors.
DefaultErrorMessages
Default user-facing error message strings (in Brazilian Portuguese).
DescriptionTooLong
Description length above maximum.
DescriptionTooShort
Description length below minimum.
DeviceInfoError
Abstract base for errors that occur while gathering device information.
DeviceInfoNotFoundError
An error indicating that the requested device information could not be found.
DeviceInfoUnknownError
An error indicating that the device information returned was unknown or malformed.
EntityNotFitError
An error indicating a domain entity failed to satisfy a constraint or rule.
FailedToCacheError
An error arising from a failed attempt to cache data.
FailedToShareError
An error indicating a content-sharing operation failed.
FailedToUnloadError
An error arising from a failed attempt to delete a cached entry.
FileAlreadyCachedError
An error arising from attempting to cache data that is already cached.
FormError
An error that occurred while validating or submitting a form.
HttpBadRequestError<T>
An HTTP 400 Bad Request error.
HttpError<T>
Abstract base for HTTP request errors.
HttpForbiddenError<T>
HttpForbiddenError models http errors with status 403
HttpGoneError<T>
HttpGoneError models http errors with status 410
HttpInternalServerError<T>
HttpInternalServerError models http errors with status 500
HttpNetworkError<T>
HttpNetworkError models errors related to network connection
HttpNotFoundError<T>
HttpNotFoundError models http errors with status 404
HttpUnauthorizedError<T>
HttpUnauthorizedError models http errors with status 401
HttpUnknownError<T>
HttpUnknownError models unknown http errors
InsufficientDetail
Detail/content insufficient for validation.
InvalidCharacters
Value contains disallowed characters.
InvalidEmail
Email failed validation.
InvalidName
Name failed validation.
InvalidOTP
OTP (one-time password) failed validation.
InvalidPassword
Password failed validation.
InvalidUserName
User name failed validation.
NoInternetConnectionError<T>
NoInternetConnectionError models errors related with failure in communication associated with failure of internet connection
NotCachedError
An error arising from trying to retrieve data that has not been cached yet.
ParseError
An error that occurred while parsing or deserializing data.
StorageError
Abstract base for storage-related errors.
StorageNotFoundError
An error indicating that the device storage could not be found.
StorageUnknownError
An unknown or unexpected storage-related error.
TokenNotFoundError
An error indicating no authentication token was found.
UnexpectedValueError<T>
Thrown when a ValueObject is read via ValueObject.getOrCrash and its Result is Failure.
UnprocessableEntityError<T>
UnprocessableEntityError models http errors with status 422
ValueError
Base error type for value validation failures (e.g. invalid email, password).

Functions

parseHttpError<T>({required DioException error, StackTrace stackTrace = StackTrace.empty, String slug = '', String handleErrorMessage({required DioException error})?, T? errorResponseSerializer(dynamic)?, String defaultErrorMessage = "Algo inesperado aconteceu. Tente novamente mais tarde.", String defaultNoInternetConnectionMessage = ''}) Future<HttpError<T>>
Maps a DioException to the most appropriate HttpError subclass.
parseSocketException<T>({required String msg, required DioException exception, String slug = '', Maybe<T> maybeErrorResponse = const Nothing()}) Future<HttpError<T>>
Resolves a connection-level DioException to NoInternetConnectionError or HttpNetworkError depending on actual device connectivity.

Exceptions / Errors

CacheException
Exception thrown when an illegal operation occurs during a caching request.
ParseException
Exception thrown when an illegal operation occurs during data parsing.