Horde_ErrorHandler
in package
Provides methods used to handle error reporting.
Copyright 2012-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
Methods
- catchFatalError() : mixed
- Catch fatal errors.
- errorHandler() : mixed
- PHP legacy error handling (non-Exceptions).
- fatal() : mixed
- Aborts with a fatal error, displaying debug information to the user.
- getHtmlForError() : string
- Returns html for an error
- getErrorDetailsAsHtml() : string
- Get the details of an error as html. This should usually only be output to admin users
Methods
catchFatalError()
Catch fatal errors.
public
static catchFatalError() : mixed
errorHandler()
PHP legacy error handling (non-Exceptions).
public
static errorHandler(int $errno, string $errstr, string $errfile, int $errline) : mixed
Parameters
- $errno : int
-
See set_error_handler().
- $errstr : string
-
See set_error_handler().
- $errfile : string
-
See set_error_handler().
- $errline : int
-
See set_error_handler().
fatal()
Aborts with a fatal error, displaying debug information to the user.
public
static fatal(mixed $error) : mixed
Parameters
- $error : mixed
-
Either a string or an object with a getMessage() method (e.g. PEAR_Error, Exception).
getHtmlForError()
Returns html for an error
public
static getHtmlForError(string|Throwable $error[, bool $isAdmin = false ]) : string
Parameters
- $error : string|Throwable
-
The error as string message or Throwable
- $isAdmin : bool = false
-
If true will also output the complete trace If $error is a Throwable its complete content will also be included in the output
Return values
string —The full html page for that error as a string
getErrorDetailsAsHtml()
Get the details of an error as html. This should usually only be output to admin users
protected
static getErrorDetailsAsHtml(string|Throwable $error) : string
Parameters
- $error : string|Throwable
-
The error as string message or Throwable
Return values
string —The details of that error as html