ErrorResult class

Represents a standardized error result.

This class is used to pass error information from the ExceptionHandler to the transport layer (HTTP, Socket, etc.) in a protocol-agnostic way.

Constructors

ErrorResult({required int statusCode, required String title, String? message, String type = 'about:blank', String? instance, dynamic details, StackTrace? stackTrace, Map<String, dynamic> extensions = const {}})
const

Properties

details → dynamic
Additional details about the error (e.g., validation errors).
final
extensions Map<String, dynamic>
Additional extensions or metadata.
final
hashCode int
The hash code for this object.
no setterinherited
instance String?
A URI reference that identifies the specific occurrence of the problem.
final
message String?
A human-readable explanation specific to this occurrence of the problem.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
The stack trace associated with the error.
final
statusCode int
The HTTP status code or equivalent error code.
final
title String
A short, human-readable summary of the problem type.
final
type String
A URI reference that identifies the problem type.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap({bool includeStackTrace = false}) Map<String, dynamic>
Convert to a Map (e.g., for JSON serialization).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited