ServiceException class final
Exception thrown when an API call fails.
- Implemented types
- Implementers
- BadGatewayException
- BadRequestException
- CancelledException
- ConflictException
- ForbiddenException
- GatewayTimeoutException
- InternalServerErrorException
- LengthRequiredException
- MethodNotAllowedException
- NotFoundException
- NotImplementedException
- PreconditionFailedException
- RequestRangeNotSatisfiableException
- RequestTimeoutException
- ServiceUnavailableException
- TooManyRequestsException
- UnauthorizedException
Constructors
- ServiceException(String message, {required int statusCode, required BaseResponse response, String? responseBody, Status? status})
- ServiceException.fromHttpResponse(BaseResponse response, String? responseBody)
-
Create a ServiceException (or appropriate subclass) from an HTTP
response.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
A message describing the cause of the exception.
final
- response → BaseResponse
-
The server response that caused the exception.
final
- responseBody → String?
-
The response body that caused the exception. May be
nullif the response body could not be decoded.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → Status?
-
The status message returned by the server.
final
- statusCode → int
-
The HTTP status code that the server returned (e.g. 404).
final
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