ErrorException
extends ErrorException
in package
implements
Exception
A custom error Exception for Psy with a formatted $message.
Interfaces, Classes and Traits
- Exception
- An interface for Psy Exceptions.
Table of Contents
- $rawMessage : mixed
- __construct() : mixed
- Construct a Psy ErrorException.
- fromError() : ErrorException
- Create an ErrorException from an Error.
- getRawMessage() : string
- Get the raw (unformatted) message for this error.
- throwException() : mixed
- Helper for throwing an ErrorException.
Properties
$rawMessage
private
mixed
$rawMessage
Methods
__construct()
Construct a Psy ErrorException.
public
__construct([string $message = '' ], int $code[, int $severity = 1 ][, string $filename = null ][, int $lineno = null ][, Exception $previous = null ]) : mixed
Parameters
- $message : string = ''
-
(default: "")
- $code : int
-
(default: 0)
- $severity : int = 1
-
(default: 1)
- $filename : string = null
-
(default: null)
- $lineno : int = null
-
(default: null)
- $previous : Exception = null
-
(default: null)
Return values
mixed —fromError()
Create an ErrorException from an Error.
public
static fromError(Error $e) : ErrorException
Parameters
- $e : Error
Return values
ErrorException —getRawMessage()
Get the raw (unformatted) message for this error.
public
getRawMessage() : string
Return values
string —throwException()
Helper for throwing an ErrorException.
public
static throwException(int $errno, string $errstr, string $errfile, int $errline) : mixed
This allows us to:
set_error_handler(array('Psy\Exception\ErrorException', 'throwException'));
Parameters
- $errno : int
-
Error type
- $errstr : string
-
Message
- $errfile : string
-
Filename
- $errline : int
-
Line number