PalaceException class abstract
for some cases you don't have access to Response
instance
like validation functionally
or building authorization servers
you may not have access to
to the res
instance so for more readable and cleaner code you can response with this exceptions
you can throw BadRequest(data?)
or NotFound
or Unauthorized
and palace will
! end the request
lifecycle
? response to the request based on your exception
so if you throw NotFound()
the palace will make the response with code 404
and if you add data to the exception it will be included in the to the response body
- Implemented types
- Implementers
Constructors
- PalaceException(int statusCode, {Object? data})
Properties
- data → Object?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusCode → int
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited