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, ]
- 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
- $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,
]
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
$logExceptionStackTrace
protected
bool
$logExceptionStackTrace
= false
Methods
handleException()
Displays the given exception
public
handleException(Throwable $exception) : mixed
Parameters
- $exception : Throwable
-
The throwable object.
Tags
anonymizeToken()
Replaces the generated token with a generic equivalent
protected
anonymizeToken(string $requestedUrl) : string
Parameters
- $requestedUrl : string
Return values
stringgetBackendUser()
protected
getBackendUser() : BackendUserAuthentication|null
Return values
BackendUserAuthentication|nullsendStatusHeaders()
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.