An exception for early-exiting a RequestController to respond to a request.

If thrown from a RequestController, a Response instance with statusCode and message is used to respond to the Request being processed. The message is returned as a value in a JSON Object for the key 'error'.

Implements
  • Exception

Constructors

HTTPResponseException(int statusCode, String message)

Creates an instance of a HTTPResponseException.

Properties

message → String

The message to return to the client.

final
response Response

A Response object derived from this exception.

read-only
statusCode → int

The status code of the Response.

final
hashCode → int

The hash code for this object.

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() → String

Returns a string representation of this object.

inherited