When Router::parseExtensions() is enabled for a file extension
that does not map to a view an infinite loop of attempting to render
View/$ext/error500.ctp will be entered. When catching
a MissingViewException check if we were trying to render an
error500. If we were, revert to safe rendering as we might enter a loop.
If an exception was raised in the AppController::beforeFilter(),
requests for content-type responses would render as HTML. Extracting the
startupProcess() allows us to keep a reference to the error controller,
which can be used to force startup RequestHandlerComponent if its
enabled.
Fixes#3389
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