NorbixError class

Base exception thrown by every Norbix call.

Use the typed subclasses (NorbixAuthError, NorbixNotFoundError, ...) when you want to react differently per HTTP status.

Implemented types
Implementers

Constructors

NorbixError({required String message, String code = 'NORBIX_ERROR', int status = 0, Map<String, dynamic> details = const {}, List<NorbixErrorItem> errors = const [], Object? body})
const
NorbixError.fromBody({required int status, Object? body, Map<String, dynamic> extraDetails = const {}})
Build the error a gateway answer describes.
factory
NorbixError.fromHttp({required int status, required String message, required String code, Map<String, dynamic> details = const {}, List<NorbixErrorItem> errors = const [], Object? body})
Construct the right typed subclass from an HTTP response. Used by the transport — you usually do not call this directly.
factory

Properties

body Object?
The answer exactly as it arrived, for whoever needs the rest of it.
final
code String
Norbix-specific error code (or NORBIX_HTTP_ERROR if the server did not provide one).
final
details Map<String, dynamic>
Full parsed response body (or transport context) for debugging.
final
errorCode String
Same value as code. The name every Norbix SDK uses for it.
no setter
errors List<NorbixErrorItem>
Every error the gateway sent, in the order it sent them.
final
hashCode int
The hash code for this object.
no setterinherited
httpStatus int
Same value as status. The name every Norbix SDK uses for it.
no setter
message String
Human-readable message extracted from the response body when possible.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status int
HTTP status code, or 0 for transport-level failures (DNS, timeout).
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