Psr3ErrorHandler
- Full name:
\Qubus\Error\Handlers\Psr3ErrorHandler
- This class is marked as final and can't be subclassed
- This class implements:
\Qubus\Error\Handlers\ErrorHandler
- This class is a Final class
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
DEFAULT_ERROR_LEVEL_MAP | private | [\ParseError::class => \Psr\Log\LogLevel::CRITICAL, \Throwable::class => \Psr\Log\LogLevel::ERROR] | |
DEFAULT_LOG_LEVEL | private | \Psr\Log\LogLevel::ERROR | |
ERROR_KEY | public | 'error' |
Properties
logger
levelMap
Defines which error levels should be mapped to certain error types.
Note: The errors are checked in order, so if you want to define fallbacks for classes higher in the tree make sure to add them to the end of the map.
ignoreSeverity
Ignores the severity when detecting the log level.
allowNonPsrLevels
Enables the handler to accept detecting non-PSR-3 log levels.
Note: when detecting an invalid level the handler will silently fall back to the default.
Methods
__construct
Parameters:
Parameter | Type | Description |
---|---|---|
$logger | \Psr\Log\LoggerInterface | |
$levelMap | array |
ignoreSeverity
Ignores the severity when detecting the log level.
Parameters:
Parameter | Type | Description |
---|---|---|
$ignoreSeverity | bool |
allowNonPsrLevels
Enables the handler to accept detecting non-PSR-3 log levels.
Parameters:
Parameter | Type | Description |
---|---|---|
$allowNonPsrLevels | bool |
handle
Parameters:
Parameter | Type | Description |
---|---|---|
$t | \Throwable | |
$context | array |
getLevel
Determines the level for the error.
Parameters:
Parameter | Type | Description |
---|---|---|
$t | \Throwable | |
$context | array |
checkLevel
Checks whether a log level exists.
Parameters:
Parameter | Type | Description |
---|---|---|
$level | string |
validateLevel
Validates whether a log level exists (if non-PSR levels are not allowed).
Parameters:
Parameter | Type | Description |
---|---|---|
$level | string |
getType
Determines the error type.
Parameters:
Parameter | Type | Description |
---|---|---|
$t | \Throwable |
Automatically generated on 2025-10-13