BusinessError class final

业务逻辑错误

服务器返回业务错误码。由业务层创建,非 Dio 直接映射。

Inheritance

Constructors

BusinessError({required String code, required String serverMessage, String? traceId, dynamic rawResponse, RequestOptions? requestOptions, StackTrace? stackTrace, Object? originalError, DateTime? timestamp})

Properties

code → String
业务错误码
final
hashCode → int
The hash code for this object.
no setterinherited
message → String
用户友好的错误消息
finalinherited
originalError → Object?
原始异常
finalinherited
rawResponse → dynamic
原始响应数据
final
requestOptions → RequestOptions?
原始请求配置(可选,非 Dio 错误可能为空)
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serverMessage → String
服务器返回的消息
final
stackTrace → StackTrace?
堆栈跟踪
finalinherited
timestamp → DateTime
错误发生时间戳
finalinherited
traceId → String?
请求追踪 ID
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