-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception message is discarded when using httpError #30
Comments
|
I think exposing the message through a getter method is a better approach. Sometimes there are multiple reasons why someone might get a particular HTTP code, and the message might be user friendly. Could we add something like
|
But then people won’t see it unless they specially design their template for it, which won’t happen most of the time. |
I guess if we force it on dev and make the message available as a variable for other environments. Maybe ResponseErrorMessage? |
How about both?
Can test out later this evening |
If a developer calls
return this->httpError(401, 'Some message for unauthorised users');
, a HTTPResponse_Exception is thrown. If an ErrorPage is not loaded, the user will receive a barebones controller response with a 401 that says "Some message for unauthorised users", which is obtained from theException::getMessage()
method.This message seems to get discarded somewhere when an ErrorPage is generated. It is not available to a published ErrorPage, and thus cannot be displayed on a template if your theme implements one.
The text was updated successfully, but these errors were encountered: