TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Error\DebugExceptionHandler Class Reference
Inheritance diagram for TYPO3\CMS\Core\Error\DebugExceptionHandler:
TYPO3\CMS\Core\Error\AbstractExceptionHandler TYPO3\CMS\Core\Error\ExceptionHandlerInterface TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct ()
 
 echoExceptionWeb ($exception)
 
 echoExceptionCLI ($exception)
 
- Public Member Functions inherited from TYPO3\CMS\Core\Error\AbstractExceptionHandler
 handleException ($exception)
 

Protected Member Functions

 getBacktraceCode (array $trace)
 
 getCodeSnippet ($filePathAndName, $lineNumber)
 
- Protected Member Functions inherited from TYPO3\CMS\Core\Error\AbstractExceptionHandler
 writeLogEntries ($exception, $context)
 
 writeLog ($logMessage)
 
 sendStatusHeaders ($exception)
 
 anonymizeToken ($requestedUrl)
 
 getBackendUser ()
 
 getDatabaseConnection ()
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Core\Error\AbstractExceptionHandler
const CONTEXT_WEB = 'WEB'
 
const CONTEXT_CLI = 'CLI'
 

Detailed Description

A basic but solid exception handler which catches everything which falls through the other exception handlers and provides useful debugging information.

This file is a backport from TYPO3 Flow

Definition at line 24 of file DebugExceptionHandler.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Error\DebugExceptionHandler::__construct ( )

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

Implements TYPO3\CMS\Core\Error\ExceptionHandlerInterface.

Definition at line 29 of file DebugExceptionHandler.php.

Member Function Documentation

◆ echoExceptionCLI()

TYPO3\CMS\Core\Error\DebugExceptionHandler::echoExceptionCLI (   $exception)

Formats and echoes the exception for the command line

Parameters
\Exception | \Throwable$exceptionThe exception object
Returns
void #72293 This will change to only if we are >= PHP7.0 only

Implements TYPO3\CMS\Core\Error\ExceptionHandlerInterface.

Definition at line 120 of file DebugExceptionHandler.php.

References TYPO3\CMS\Core\Error\AbstractExceptionHandler\writeLogEntries().

◆ echoExceptionWeb()

TYPO3\CMS\Core\Error\DebugExceptionHandler::echoExceptionWeb (   $exception)

Formats and echoes the exception as XHTML.

Parameters
\Exception | \Throwable$exceptionThe exception object
Returns
void #72293 This will change to only if we are >= PHP7.0 only

Implements TYPO3\CMS\Core\Error\ExceptionHandlerInterface.

Definition at line 41 of file DebugExceptionHandler.php.

References TYPO3\CMS\Core\Error\DebugExceptionHandler\getBacktraceCode(), TYPO3\CMS\Core\Utility\ClientUtility\getBrowserInfo(), TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv(), TYPO3\CMS\Core\Error\AbstractExceptionHandler\sendStatusHeaders(), and TYPO3\CMS\Core\Error\AbstractExceptionHandler\writeLogEntries().

◆ getBacktraceCode()

TYPO3\CMS\Core\Error\DebugExceptionHandler::getBacktraceCode ( array  $trace)
protected

Renders some backtrace

Parameters
array$traceThe trace
Returns
string Backtrace information

Definition at line 140 of file DebugExceptionHandler.php.

References TYPO3\CMS\Core\Error\DebugExceptionHandler\getCodeSnippet().

Referenced by TYPO3\CMS\Core\Error\DebugExceptionHandler\echoExceptionWeb().

◆ getCodeSnippet()

TYPO3\CMS\Core\Error\DebugExceptionHandler::getCodeSnippet (   $filePathAndName,
  $lineNumber 
)
protected

Returns a code snippet from the specified file.

Parameters
string$filePathAndNameAbsolute path and file name of the PHP file
int$lineNumberLine number defining the center of the code snippet
Returns
string The code snippet

Definition at line 194 of file DebugExceptionHandler.php.

Referenced by TYPO3\CMS\Core\Error\DebugExceptionHandler\getBacktraceCode().