StorageError class sealed
Typed error hierarchy for storage operations.
Every storage error is a sealed subtype of StorageError and carries the storage key that caused it (when applicable). Pattern-match on the concrete type for granular handling; catch StorageError as a final fallback.
try {
await cellar.read('missing/key');
} on FileNotFoundError catch (e) {
print('Not found: ${e.key}');
} on CorruptedFileError catch (e) {
print('Corrupted: ${e.key}, cause: ${e.cause}');
} on StorageError catch (e) {
print('Storage error: ${e.message}');
}
- Implemented types
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String?
-
The storage key involved in the error (null for non-key-specific errors).
final
- message → String
-
Human-readable error description.
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