MantisBT: master ec8a2af0

Author Committer Branch Timestamp Parent
dregad dregad master 2026-01-04 19:10 master 388f105a
Affected Issues  0036812: PHP 8.4: Passing E_USER_ERROR to trigger_error() is deprecated
Changeset

Use an Exception to send data to error_output()

Add a new ErrorHandlerException class, extending ErrorException and used
as a vector to pass error datan from error_handler() to error_output().
This is a "dummy" exception (i.e. not meant to be thrown).

Add new public method getErrorType() to MantisException.

Change error_output() to accept a Throwable (MantisException or
ErrorHandlerException) as parameter, instead of 5 individual values.

This simplifies error_exception_handler() and error_handler(). The
latter creates an ErrorHandlerException based on the error and adapts it
according to its type and the context.

Fixes 0036812

mod - core/error_api.php Diff File
add - core/exceptions/ErrorHandlerException.php Diff File
mod - core/exceptions/MantisException.php Diff File