NmApiException class

An API error ({error: {code, message, details, requestId}}) or a network failure (NETWORK_ERROR, TIMEOUT).

Implemented types

Constructors

NmApiException({required String code, required String message, int? statusCode, String? requestId, List<Map<String, dynamic>> details = const []})
Creates an exception.
const

Properties

code → String
Machine-readable code, e.g. VALIDATION_ERROR, or HTTP_<status> when the body had none.
final
details → List<Map<String, dynamic>>
error.details.
final
hashCode → int
The hash code for this object.
no setterinherited
isNetwork → bool
A network failure or timeout.
no setter
message → String
Human-readable message.
final
requestId → String?
Request id from the body or the x-request-id header.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statusCode → int?
HTTP status; null for network failures.
final

Methods

detail(String key) → Object?
The first value of key in details.
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