Commit 7416c53 shows error message from last exception instead of first one
and also displays framework specific error messages instead of generic ones with debug off.
We don't want either.
This reverts commit 7416c530a2.
Since many exceptions do not have its own 'template' file, customized
APP/Controller/CakeErrorController with its own list of helpers could be
ignored.
This happens becase ExceptionRenderer is forced to to use _outputMessageSafe
when a template is missing. This causes Controller::$helpers to be reset with
default values.
The most recent request in the request stack should be used,
as it is most likely the request containing an exception.
Fixes incorrect error pages generated inside requestAction() calls.
Fixes#2746
- Adding RequestHandler to the error controller. This allows reuse
of all of Cake's internals.
- Adding a simple JsonView class to do serialized JSON views.
- Adding serialize hooks, and wiring things together.
CakeException subclasses without their own view files, would trigger
a MissingViewException, which would result in no application helpers
being used. This could cause issues when app helpers are used
in the layout.
Instead a error500 template is rendered using app helpers.
Fixes#2274, fixes#2004
Fix issue where unknown exceptions with error codes that were not
in HTTP ranges would be ignored. In development those messages
should display.
Fixes#2205
After some discussion, polutting the app POT file
with unchanging Cake strings was incorrect. Having these
strings in a separate POT file allows reuse of translations across
projects.
Refs #2103
This domain was supposed to be replaced by cake_dev.
There are a number of translations that should be App land as well.
Such as those in helpers.
Fixes#2103
Uncaught exceptions on the console would result in exit code 0.
This is not helpful in *nix scripting.
- Update the ConsoleErrorHandler to not inherit from the web error handler.
- Make ErrorHandler::_mapErrorCode() public as it isn't overly private.
- Make ConsoleErrorHandler methods instance methods so mocking can be done.
- Add a _stop method to correctly exit.
- Update tests.