KoolbaseException class abstract

The root of every error the SDK raises.

Each subsystem has its own family beneath this — data, storage, auth — so an application can catch narrowly where it wants to and broadly where it does not:

try {
  await Koolbase.storage.upload(...);
} on KoolbaseUnauthenticatedException {
  await goToLogin();          // any surface, one handler
} on KoolbaseStorageException catch (e) {
  showError(e.message);       // storage-specific
} on KoolbaseException catch (e) {
  report(e);                  // anything else from the SDK
}

The families used to be unrelated roots, which meant a failure that belongs to no single subsystem — a rejected session, discovered by whichever call happened to make it — had to be redefined in each one, and applications wrote the same handler several times.

Implemented types
Implementers

Constructors

KoolbaseException(String message, {String? code})
const

Properties

code → String?
The server's stable error code, when it sent one. Prefer branching on the exception type; this is for logging and for codes the SDK does not yet map.
final
hashCode → int
The hash code for this object.
no setterinherited
message → String
What went wrong, in words. From the server where it said something useful.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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