AbstractExceptionHandler implements ExceptionHandlerInterface, SingletonInterface, LoggerAwareInterface uses LoggerAwareTrait

AbstractYes

An abstract exception handler

This file is a backport from TYPO3 Flow

Table of Contents

Interfaces

ExceptionHandlerInterface
Contract for an exception handler
SingletonInterface
"empty" interface for singletons (marker interface pattern)
LoggerAwareInterface

Constants

CONTEXT_CLI  = 'CLI'
CONTEXT_WEB  = 'WEB'
IGNORED_HMAC_EXCEPTION_CODES  = [ 1581862822, // Failed HMAC validation due to modified __trustedProperties in extbase property mapping 1581862823, // Failed HMAC validation due to modified form state in ext:forms 1320830018, // Failed HMAC validation due to modified HMAC string in Extbase HashService 1320830276, ]
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, // Outdated __trustedProperties format in extbase property mapping 1517949792, // The IP address of your client does not match the list of allowed IP addresses 1517949793, // Backend access by browser is locked for maintenance 1517949794, // Backend and Install Tool are locked for maintenance 1436717270, // Client sends a header with an invalid name 1436717269, ]

Properties

$logExceptionStackTrace  : bool

Methods

handleException()  : mixed
Displays the given exception
anonymizeToken()  : string
Replaces the generated token with a generic equivalent
getBackendUser()  : BackendUserAuthentication|null
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, // Failed HMAC validation due to modified form state in ext:forms 1320830018, // Failed HMAC validation due to modified HMAC string in Extbase HashService 1320830276, ]

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, // Outdated __trustedProperties format in extbase property mapping 1517949792, // The IP address of your client does not match the list of allowed IP addresses 1517949793, // Backend access by browser is locked for maintenance 1517949794, // Backend and Install Tool are locked for maintenance 1436717270, // Client sends a header with an invalid name 1436717269, ]

Properties

$logExceptionStackTrace

protected bool $logExceptionStackTrace = false

Methods

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

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