ForbiddenFailure class final
Forbidden failures (403 HTTP errors)
Use when the user is authenticated but lacks permission to access the requested resource.
- Inheritance
-
- Object
- AppFailure
- ForbiddenFailure
- Available extensions
Constructors
- ForbiddenFailure(String message, {String? requiredPermission, String? code, StackTrace? stackTrace, Object? cause})
-
const
Properties
- cause → Object?
-
The original error/exception that caused this failure
finalinherited
- code → String?
-
Machine-readable error code (e.g. a GraphQL error type name such as
InsufficientStockError). Optional; most failures are identified by message alone.finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
Human-readable error message
finalinherited
- requiredPermission → String?
-
The permission that was required but not granted
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
Stack trace from where the failure originated
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toFailure(
[StackTrace? stackTrace]) → AppFailure -
Available on Exception, provided by the ExceptionToFailure extension
Convert this exception to an AppFailure -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
from(
Object error, StackTrace? stackTrace) → ForbiddenFailure? - Factory that creates a ForbiddenFailure if the error matches, otherwise returns null