TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractExceptionHandler Class Reference
Inheritance diagram for AbstractExceptionHandler:
ExceptionHandlerInterface SingletonInterface DebugExceptionHandler ProductionExceptionHandler

Public Member Functions

 handleException (\Throwable $exception)
 
- Public Member Functions inherited from ExceptionHandlerInterface
 __construct ()
 
 echoExceptionWeb (\Throwable $exception)
 
 echoExceptionCLI (\Throwable $exception)
 

Public Attributes

const CONTEXT_WEB = 'WEB'
 
const CONTEXT_CLI = 'CLI'
 

Protected Member Functions

 writeLogEntries (\Throwable $exception, $context)
 
 writeLog ($logMessage)
 
 sendStatusHeaders (\Throwable $exception)
 
 getBackendUser ()
 

Detailed Description

An abstract exception handler

This file is a backport from TYPO3 Flow

Definition at line 25 of file AbstractExceptionHandler.php.

Member Function Documentation

getBackendUser ( )
protected
Returns

Definition at line 162 of file AbstractExceptionHandler.php.

References $GLOBALS.

Referenced by AbstractExceptionHandler\writeLog().

handleException ( \Throwable  $exception)

Displays the given exception

Parameters
\Throwable$exceptionThe throwable object.
Exceptions
Exception

Implements ExceptionHandlerInterface.

Definition at line 37 of file AbstractExceptionHandler.php.

References ExceptionHandlerInterface\echoExceptionCLI(), and ExceptionHandlerInterface\echoExceptionWeb().

sendStatusHeaders ( \Throwable  $exception)
protected

Sends the HTTP Status 500 code, if $exception is not a TYPO3 and headers are not sent, yet.

Parameters
\Throwable$exceptionThe throwable object.
Returns
void

Definition at line 145 of file AbstractExceptionHandler.php.

References HttpUtility\HTTP_STATUS_500.

Referenced by DebugExceptionHandler\echoExceptionWeb(), and ProductionExceptionHandler\echoExceptionWeb().

writeLog (   $logMessage)
protected

Writes an exception in the sys_log table

Parameters
string$logMessageDefault text that follows the message.
Returns
void

Definition at line 97 of file AbstractExceptionHandler.php.

References $GLOBALS, AbstractExceptionHandler\getBackendUser(), GeneralUtility\getIndpEnv(), and GeneralUtility\makeInstance().

Referenced by AbstractExceptionHandler\writeLogEntries().

writeLogEntries ( \Throwable  $exception,
  $context 
)
protected

Writes exception to different logs

Parameters
\Throwable$exceptionThe throwable object.
string$contextThe context where the exception was thrown, WEB or CLI
Returns
void
See also
::sysLog(), ::devLog()

Definition at line 56 of file AbstractExceptionHandler.php.

References GeneralUtility\devLog(), GeneralUtility\getIndpEnv(), GeneralUtility\SYSLOG_SEVERITY_FATAL, and AbstractExceptionHandler\writeLog().

Referenced by ProductionExceptionHandler\echoExceptionCLI(), DebugExceptionHandler\echoExceptionCLI(), DebugExceptionHandler\echoExceptionWeb(), and ProductionExceptionHandler\echoExceptionWeb().

Member Data Documentation

const CONTEXT_CLI = 'CLI'

Definition at line 28 of file AbstractExceptionHandler.php.

const CONTEXT_WEB = 'WEB'

Definition at line 27 of file AbstractExceptionHandler.php.