ResponseError class Null safety

Error information class

Provides details of an error after the execution of an API call. It should be instantiated in every response object when there is an error of some sort during the execution. All the API responses should return a class extending APIResponse which stores in APIResponse.error and instance of ResponseError

Mixed in types

Constructors

ResponseError({required ErrorCode code, required String message, String? context, String? target})
Builds a ResponseError [...]
ResponseError.aborted({required String message, String? context, String? target})
Builds a aborted ResponseError with ErrorCode.aborted and: [...]
ResponseError.authentication({required String message, String? context, String? target})
Builds a authentication ResponseError with ErrorCode.authentication and: [...]
ResponseError.authorization({required String message, String? context, String? target})
Builds a authorization ResponseError with ErrorCode.authorization and: [...]
ResponseError.backendResponse({required String message, String? context, String? target})
Builds a backend response ResponseError with ErrorCode.backendResponse and: [...]
ResponseError.backendStatus({required String message, String? context, String? target})
Builds a backend status ResponseError with ErrorCode.backendStatus and: [...]
ResponseError.backendTimeout({required String message, String? context, String? target})
Builds a backend timeout ResponseError with ErrorCode.backendTimeout and: [...]
ResponseError.conflict({required String message, String? context, String? target})
Builds a conflict ResponseError with ErrorCode.conflict and: [...]
ResponseError.fromJson(Map<String, dynamic> json)
Creates a ResponseError from json map
factory
ResponseError.notFound({required String message, String? context, String? target})
Builds a not found ResponseError with ErrorCode.notFound and: [...]
ResponseError.unknown({required String message, String? context, String? target})
Builds a unknown ResponseError with ErrorCode.unknown and: [...]
ResponseError.unprocessableEntity({required String message, String? context, String? target})
Builds a unprocessable entity ResponseError with ErrorCode.unprocessableEntity and: [...]

Properties

code ErrorCode
The error code
read / write
context String?
The context of execution when the error occurred
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
message String
The error message
read / write
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props. [...]
read-only, inherited
target String?
The target entity of the API that triggered this error
read / write

Methods

copyWith({ErrorCode? code, String? message, String? context, String? target}) ResponseError
Builds a copy of a ResponseError [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, dynamic>
Creates a json map from a ResponseError
toString() String
A string representation of this object. [...]
inherited

Operators

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