ForbiddenException class

Exception thrown when access is forbidden (403 Forbidden).

Example:

try {
  await client.get('/admin');
} on ForbiddenException catch (e) {
  print('Access denied');
}
Inheritance

Constructors

ForbiddenException({String message = 'Forbidden', dynamic responseBody, Object? originalError, StackTrace? stackTrace})
Creates a ForbiddenException with the given message.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
message String
Human-readable error message.
finalinherited
originalError Object?
The original error that caused this exception.
finalinherited
responseBody → dynamic
The response body if available.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
The stack trace from the original error.
finalinherited
statusCode int?
HTTP status code if available.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited