BreakHook class
Exception to break hook execution early and control return value.
Stops remaining hooks and returns from the cache operation.
Example:
if (isExpired) {
await ctx.entry.delete(ctx.resolvedKey!);
throw BreakHook('Entry expired', BreakReturnType.none); // Returns null
}
- Implemented types
Constructors
- BreakHook([String message = 'Hook execution halted.', BreakReturnType returnType = BreakReturnType.none])
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
Description of why execution was halted.
final
- returnType → BreakReturnType
-
Controls return value: none (null), initial, or resolved.
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