ProductionExceptionHandler extends AbstractExceptionHandler

An exception handler which catches any exception and renders an error page without backtrace (Web) or a slim message on CLI.

Table of Contents

Constants

CONTEXT_CLI  = 'CLI'
CONTEXT_WEB  = 'WEB'
IGNORED_HMAC_EXCEPTION_CODES  = [ 1581862822, // Failed HMAC validation due to modified __trustedProperties in extbase property mapping 1581862823, ]
IGNORED_EXCEPTION_CODES  = [ 1396795884, // Current host header value does not match the configured trusted hosts pattern 1616175867, // Backend login request is rate limited 1616175847, // Frontend login request is rate limited 1436717275, // Request with unsupported HTTP method 1699604555, ]

Properties

$defaultMessage  : string
Default message for error messages
$defaultTitle  : string
Default title for error messages
$logExceptionStackTrace  : bool

Methods

__construct()  : mixed
Constructs this exception handler - registers itself as the default exception handler.
echoExceptionCLI()  : mixed
Echoes an exception for the command line.
echoExceptionWeb()  : mixed
Echoes an exception for the web.
handleException()  : mixed
Displays the given exception
anonymizeToken()  : string
Replaces the generated token with a generic equivalent
discloseExceptionInformation()  : bool
Determines, whether Exception details should be outputted
getBackendUser()  : BackendUserAuthentication|null
getMessage()  : string
Returns the message for the error message
getTitle()  : string
Returns the title for the error message
sendStatusHeaders()  : mixed
Sends the HTTP Status 500 code, if $exception is *not* a TYPO3\CMS\Core\Error\Http\StatusException and headers are not sent, yet.
writeLog()  : mixed
Writes an exception in the sys_log table
writeLogEntries()  : void
Writes exception to different logs

Constants

CONTEXT_CLI

public mixed CONTEXT_CLI = 'CLI'

CONTEXT_WEB

public mixed CONTEXT_WEB = 'WEB'

IGNORED_HMAC_EXCEPTION_CODES

public mixed IGNORED_HMAC_EXCEPTION_CODES = [ 1581862822, // Failed HMAC validation due to modified __trustedProperties in extbase property mapping 1581862823, ]

IGNORED_EXCEPTION_CODES

protected mixed IGNORED_EXCEPTION_CODES = [ 1396795884, // Current host header value does not match the configured trusted hosts pattern 1616175867, // Backend login request is rate limited 1616175847, // Frontend login request is rate limited 1436717275, // Request with unsupported HTTP method 1699604555, ]

Properties

$defaultMessage

Default message for error messages

protected string $defaultMessage = ''

$defaultTitle

Default title for error messages

protected string $defaultTitle = 'Oops, an error occurred!'

$logExceptionStackTrace

protected bool $logExceptionStackTrace = false

Methods

__construct()

Constructs this exception handler - registers itself as the default exception handler.

public __construct() : mixed

echoExceptionCLI()

Echoes an exception for the command line.

public echoExceptionCLI(Throwable $exception) : mixed
Parameters
$exception : Throwable

The throwable object.

echoExceptionWeb()

Echoes an exception for the web.

public echoExceptionWeb(Throwable $exception) : mixed
Parameters
$exception : Throwable

The throwable object.

handleException()

Displays the given exception

public handleException(Throwable $exception) : mixed
Parameters
$exception : Throwable

The throwable object.

Tags
throws
Exception

anonymizeToken()

Replaces the generated token with a generic equivalent

protected anonymizeToken(string $requestedUrl) : string
Parameters
$requestedUrl : string
Return values
string

discloseExceptionInformation()

Determines, whether Exception details should be outputted

protected discloseExceptionInformation(Throwable $exception) : bool
Parameters
$exception : Throwable

The throwable object.

Return values
bool

getMessage()

Returns the message for the error message

protected getMessage(Throwable $exception) : string
Parameters
$exception : Throwable

The throwable object.

Return values
string

getTitle()

Returns the title for the error message

protected getTitle(Throwable $exception) : string
Parameters
$exception : Throwable

The throwable object.

Return values
string

sendStatusHeaders()

Sends the HTTP Status 500 code, if $exception is *not* a TYPO3\CMS\Core\Error\Http\StatusException and headers are not sent, yet.

protected sendStatusHeaders(Throwable $exception) : mixed
Parameters
$exception : Throwable

The throwable object.

writeLog()

Writes an exception in the sys_log table

protected writeLog(string $logMessage) : mixed
Parameters
$logMessage : string

Default text that follows the message.

writeLogEntries()

Writes exception to different logs

protected writeLogEntries(Throwable $exception, string $mode) : void
Parameters
$exception : Throwable

The throwable object.

$mode : string

The context where the exception was thrown. Either self::CONTEXT_WEB or self::CONTEXT_CLI.


        
On this page

Search results