Documentation

Error extends Exception
in package

Class \Hoa\Exception\Error.

This exception is the equivalent representation of PHP errors.

Tags
copyright

Copyright © 2007-2017 Hoa community

license

New BSD License

Table of Contents

Properties

$_arguments  : array<string|int, mixed>
Arguments to format message.
$_previous  : Exception
Previous.
$_rawMessage  : string
Original message.
$_tmpArguments  : array<string|int, mixed>
Delay processing on arguments.
$_trace  : array<string|int, mixed>
Backtrace.

Methods

__construct()  : mixed
Constructor.
__toString()  : string
String representation of object.
enableErrorHandler()  : mixed
Enable error handler: Transform PHP error into `\Hoa\Exception\Error`.
enableUncaughtHandler()  : mixed
Enable uncaught exception handler.
getArguments()  : array<string|int, mixed>
Get arguments for the message.
getBacktrace()  : array<string|int, mixed>
Get the backtrace.
getFormattedMessage()  : string
Get the message already formatted.
getFrom()  : string
Get the source of the exception (class, method, function, main etc.).
getPreviousThrow()  : Exception
Get previous.
getRawMessage()  : string
Get the raw message.
raise()  : string
Raise an exception as a string.
send()  : void
Send the exception on hoa://Event/Exception.
uncaught()  : void
Catch uncaught exception (only \Hoa\Exception\Idle and children).

Properties

$_arguments

Arguments to format message.

protected array<string|int, mixed> $_arguments = null

$_previous

Previous.

protected Exception $_previous = null

$_rawMessage

Original message.

protected string $_rawMessage = null

$_tmpArguments

Delay processing on arguments.

protected array<string|int, mixed> $_tmpArguments = null

$_trace

Backtrace.

protected array<string|int, mixed> $_trace = null

Methods

__construct()

Constructor.

public __construct(string $message, int $code, string $file, int $line[, array<string|int, mixed> $trace = [] ]) : mixed
Parameters
$message : string

Message.

$code : int

Code (the ID).

$file : string

File.

$line : int

Line.

$trace : array<string|int, mixed> = []

Trace.

__toString()

String representation of object.

public __toString() : string
Return values
string

enableErrorHandler()

Enable error handler: Transform PHP error into `\Hoa\Exception\Error`.

public static enableErrorHandler([bool $enable = true ]) : mixed
Parameters
$enable : bool = true

Enable.

enableUncaughtHandler()

Enable uncaught exception handler.

public static enableUncaughtHandler([bool $enable = true ]) : mixed

This is restricted to Hoa's exceptions only.

Parameters
$enable : bool = true

Enable.

getArguments()

Get arguments for the message.

public getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>

getBacktrace()

Get the backtrace.

public getBacktrace() : array<string|int, mixed>

Do not use \Exception::getTrace() any more.

Return values
array<string|int, mixed>

getFormattedMessage()

Get the message already formatted.

public getFormattedMessage() : string
Return values
string

getFrom()

Get the source of the exception (class, method, function, main etc.).

public getFrom() : string
Return values
string

getPreviousThrow()

Get previous.

public getPreviousThrow() : Exception

Do not use \Exception::getPrevious() any more.

Return values
Exception

getRawMessage()

Get the raw message.

public getRawMessage() : string
Return values
string

raise()

Raise an exception as a string.

public raise([bool $previous = false ]) : string
Parameters
$previous : bool = false

Whether raise previous exception if exists.

Return values
string

send()

Send the exception on hoa://Event/Exception.

public send() : void

uncaught()

Catch uncaught exception (only \Hoa\Exception\Idle and children).

public static uncaught(Throwable $exception) : void
Parameters
$exception : Throwable

The exception.

Tags
throws
Throwable

        
On this page

Search results