NAME
Articulate::Error - represent an error or exception in processing a request
FUNCTIONS
throw_error
throw_error 'Forbidden';
throw_error NotFound => "I don't want to alarm you, but it seems to be missiong";
This creates an error of the type provided and throws it immediately. These are things like Articulate::Error::Forbidden
.
METHODS
new
An ordinary Moo constructor.
throw
Implements the Throwable
role - basically die __PACKAGE__->new(@_)
.
ATTRIBUTES
simple_message
Be kind and let the user know what happened, in summary. Default is 'An unknown error has occurred'.
That said, do consider whether this is the right place to put potentially sensitive diagnostic information.
http_code
The equivalent status code.
Defaults to 500, always an integer.
caller
Tries to take a sensible guess at where in your code this was actually thrown from. This may vary, don't rely on it!