Skip to content

Remove deprecated option E_USER_ERROR in stdErr() and handle exceptions with a dedicated handler #8

@blancks

Description

@blancks

Current Behavior:
The codebase currently treats E_USER_ERROR as a stdErr() level option by internally calling PHP’s trigger_error() function. However, this approach is deprecated as of PHP 8.2. Since E_USER_ERROR is not actively used anywhere in the code, this behavior is unnecessary and should be removed.

Additionally, exception messages are currently converted and output to stderr without actually stopping script execution. This requires additional boilerplate logic to manually exit with code 1, making error handling less reliable and more cumbersome.

Expected Behavior:
Error handling should use proper exception handling mechanisms. An exception handler should be implemented, and all code that converts exception messages to stderr should be removed in favor of throwing and catching exceptions directly.

Additional Context:
Updating to modern exception handling will improve maintainability, make error tracking more reliable, and ensure compatibility with future PHP versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions