Skip to content
PHP Ecosystem
Explore

ErrorException

API reference › yii › base › ErrorException

classyii\base\ErrorException
ExtendsErrorException
Since2.0
Sourceframework/base/ErrorException.php

ErrorException represents a PHP error.

For more details and usage information on ErrorException, see the guide article on handling errors.

MethodDescriptionDefined by
__construct()Constructs the exception.ErrorException
getName()ErrorException
isFatalError() staticReturns if error is one of fatal type.ErrorException
public function __construct(string $message = '', int $code = 0, int $severity = 1, string $filename = __FILE__, int $lineno = __LINE__, Throwable|null $previous = null)

Constructs the exception.

Parameters

ParameterTypeDescription
$messagestring[optional]
$codeint[optional]
$severityint[optional]
$filenamestring[optional]
$linenoint[optional]
$previousThrowable|null[optional]
public function getName(): string

Returns

string: The user-friendly name of this exception

public static function isFatalError(array $error): bool

Returns if error is one of fatal type.

Parameters

ParameterTypeDescription
$errorarrayError got from error_get_last()

Returns

bool: If error is one of fatal type