\NetCommonsExceptionRenderer

Exception Renderer.

Captures and handles all unhandled exceptions. Displays helpful framework errors when debug > 1. When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown and it is a type that ExceptionHandler does not know about it will be treated as a 500 error.

Implementing application specific exception rendering

You can implement application specific exception handling in one of a few ways:

  • Create a AppController::appError();
  • Create a subclass of YAExceptionRenderer and configure it to be the Exception.renderer

Using AppController::appError();

This controller method is called instead of the default exception handling. It receives the thrown exception as its only argument. You should implement your error handling in that method.

Using a subclass of YAExceptionRenderer

Using a subclass of YAExceptionRenderer gives you full control over how Exceptions are rendered, you can configure your class in your core.php, with Configure::write('Exception.renderer', 'MyClass'); You should place any custom exception renderers in app/Lib/Error.

Summary

Methods
Properties
Constants
error400()
error500()
No public properties found
No constants found
_get400Message()
_is403And404()
_get403And404Redirect()
_setError()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

error400()

error400(\Exception  $error) : void

Convenience method to display a 400 series page.

Parameters

\Exception $error

Exception

error500()

error500(\Exception  $error) : void

Convenience method to display a 500 page.

Parameters

\Exception $error

Exception

_get400Message()

_get400Message(\Exception  $error) : string

エラーメッセージ取得

Parameters

\Exception $error

Exception

Returns

string —

$message

_is403And404()

_is403And404(\Exception  $error) : boolean

403か404のエラーかチェックする

Parameters

\Exception $error

Exception

Returns

boolean

_get403And404Redirect()

_get403And404Redirect() : array

リダイレクトURLを取得する。

Returns

array —

array($redirect, $redirectUrl)

_setError()

_setError(string  $template, \Exception  $error, array  $results) : void

エラーをコントローラにセット

Parameters

string $template

viewテンプレート

\Exception $error

Exception

array $results

viewにセットする配列