xp-framework/rfc — Issue #46: Make core errors catchable
Author: thekid
Created: 2011-10-17 15:44:52+00:00
State: closed
Labels: framework, rejected

Scope of Change
====
Certain core errors should be catchable in userland.

Rationale
====
When using ClassLoader::defineClass(), an error in the class definition
should not cause the script to exit. Instead, an exception should be
thrown.

Functionality
====
This functionality will be implemented by changing places that use
xp::error() to trigger_error() with the error level "E_USER_ERROR". In
the default error handler implementation, this will terminate the
script.

In places where there is a need to be able to catch these errors,
the error handler can be changed by means of set_error_handler().

Example
----

```php

```

Security considerations
====
n/a

Speed impact
====
Small speed impact in error handler

Dependencies
====
n/a

Related documents
====
n/a