LuckyParseException class

Thrown when a LuckyResponse parsing helper fails to cast the response body to the expected type.

Wraps the original cause (typically a TypeError) so that callers can inspect the underlying error if needed.

try {
  final body = response.json();
} on LuckyParseException catch (e) {
  print('Parse failed: ${e.message}');
  print('Cause: ${e.cause}');
}
Inheritance

Constructors

LuckyParseException(String message, {Object? cause})
Creates a LuckyParseException with a descriptive message and the optional cause.

Properties

cause Object?
The original error that caused the parse failure, typically a TypeError.
final
hashCode int
The hash code for this object.
no setterinherited
message String
The human-readable error message.
finalinherited
response LuckyResponse?
The LuckyResponse that triggered this exception, if available.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?
The HTTP status code associated with this error, if available.
finalinherited

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