SPNetworkException class

A typed failure without navigation, storage, or UI side effects.

cause, uri, body, and headers can contain sensitive information. They are deliberately excluded from toString. Never log them blindly.

Implemented types

Constructors

SPNetworkException({required SPNetworkErrorType type, required String message, required String method, required Uri uri, int? statusCode, Object? body, Map<String, String> headers = const {}, Object? cause, StackTrace? stackTrace, int attempt = 1})
Creates a network failure.
const

Properties

attempt → int
One-based transport attempt number.
final
body → Object?
Error body, decoded as JSON when possible, otherwise text.
final
cause → Object?
Original transport, provider, or decoder error, when available.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, String>
Response headers. May include cookies or other private values.
final
message → String
A safe default description; apps may localize it by type.
final
method → String
Uppercase HTTP method.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackTrace → StackTrace?
Stack trace associated with cause.
final
statusCode → int?
HTTP status, when a response was received.
final
type → SPNetworkErrorType
Machine-readable failure classification.
final
uri → Uri
Requested URL. May contain private query parameters.
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