ErrorConverter class

The error converter maps server exceptions to JSON:API responses. It is designed to be used with the TryCatchHandler from the json_api:http package and provides some meaningful defaults out of the box.

Constructors

ErrorConverter({Future<Response> onMethodNotAllowed(MethodNotAllowed)?, Future<Response> onUnmatchedTarget(UnmatchedTarget)?, Future<Response> onCollectionNotFound(CollectionNotFound)?, Future<Response> onResourceNotFound(ResourceNotFound)?, Future<Response> onRelationshipNotFound(RelationshipNotFound)?, Future<Response> onError(dynamic, StackTrace)?})

Properties

hashCode int
The hash code for this object.
no setterinherited
onCollectionNotFound Future<Response> Function(CollectionNotFound)?
final
onError Future<Response> Function(dynamic, StackTrace)?
final
onMethodNotAllowed Future<Response> Function(MethodNotAllowed)?
final
onRelationshipNotFound Future<Response> Function(RelationshipNotFound)?
final
onResourceNotFound Future<Response> Function(ResourceNotFound)?
final
onUnmatchedTarget Future<Response> Function(UnmatchedTarget)?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(Object? error, StackTrace trace) Future<Response>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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