TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
AbstractExceptionHandler Class Reference
Inheritance diagram for AbstractExceptionHandler:
ExceptionHandlerInterface SingletonInterface DebugExceptionHandler ProductionExceptionHandler

Public Member Functions

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

Public Attributes

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

Protected Member Functions

 writeLogEntries (\Exception $exception, $context)
 
 writeLog ($logMessage)
 
 sendStatusHeaders (\Exception $exception)
 
 getDatabaseConnection ()
 

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

getDatabaseConnection ( )
protected

Gets the Database Object

Returns
DatabaseConnection

Definition at line 151 of file AbstractExceptionHandler.php.

References $GLOBALS.

Referenced by AbstractExceptionHandler\writeLog().

handleException ( \Exception  $exception)

Displays the given exception

Parameters
\Exception$exceptionThe exception object
Returns
void

Implements ExceptionHandlerInterface.

Definition at line 36 of file AbstractExceptionHandler.php.

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

sendStatusHeaders ( \Exception  $exception)
protected

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

Parameters
\Exception$exception
Returns
void

Definition at line 133 of file AbstractExceptionHandler.php.

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 96 of file AbstractExceptionHandler.php.

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

Referenced by AbstractExceptionHandler\writeLogEntries().

writeLogEntries ( \Exception  $exception,
  $context 
)
protected

Writes exception to different logs

Parameters
\Exception$exceptionThe exception
string$contextThe context where the exception was thrown, WEB or CLI
Returns
void
See Also
::sysLog(), ::devLog()

Definition at line 55 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.