Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow PHP Error to let existing handlers, go first #69

Open
JosephLenton opened this issue Mar 25, 2013 · 0 comments
Open

allow PHP Error to let existing handlers, go first #69

JosephLenton opened this issue Mar 25, 2013 · 0 comments

Comments

@JosephLenton
Copy link
Owner

Currently, PHP Error replaces any existing handlers, and just forces it's self to become the main handler. The problem here, is that people are using PHP Error with existing code, which has existing error handlers.

So PHP Error needs some mechanism for working with these in different ways, and some policy about how it works in relation to others.

According to the PHP docs, a handler is supposed to return true, if the error has been handled. So in theory, PHP Error could run any existing handler set before it, and only run if that handler failed to return true.

The debate comes down to what the default context should be. The way I see it, the options are:

  • People are using PHP Error to replace any existing error handling, and so should take over the error handler. In this scenario, an option is provided to allow PHP Error to run existing handlers first.
  • People want to use PHP Error as a fallback for existing error handling, and so should always let an existing handler go first. An option is provided, for PHP Error to ignore this, and let an existing handler go first.

The default behaviour can be decided later, but for now the code should be changed to capture any existing handlers, and allow them to be run before the current handler. A boolean option can then decide if that is on or not (with the default set in the __construct).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant