BloomRpcDecodeException class
Exception thrown when a 2xx response payload fails to decode into the expected output type TOutput.
Distinguishes contract mismatches ("the server returned unexpected data") from network or HTTP errors.
try {
await client.call(getUserContract, null);
} on BloomRpcDecodeException catch (e) {
print('Contract mismatch: ${e.message}');
print('Raw data was: ${e.rawData}');
}
- Implemented types
Constructors
- BloomRpcDecodeException({required Object cause, required dynamic rawData, BloomRpcContract? contract, Uri? uri, StackTrace? stackTrace, String? message})
-
Creates a BloomRpcDecodeException with decode
causeand offendingrawData.
Properties
- cause → Object
-
The underlying decode or cast error thrown by BloomRpcContract.decodeOutput.
final
- contract → BloomRpcContract?
-
The RPC contract that was executing when the error occurred, or
null.final - hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
Error summary message.
final
- rawData → dynamic
-
The raw decoded JSON object or string that failed to match the contract.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
Stack trace from the decoder failure.
final
- uri → Uri?
-
The target URI of the failed request, or
null.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