cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to intercept Magento\Framework\App\ErrorHandler or use different error_handler

0 Kudos

Unable to intercept Magento\Framework\App\ErrorHandler or use different error_handler

Feature request from stefandoorn, posted on GitHub Feb 12, 2016

The way the ErrorHandler is loaded in Framework\App\Bootstrap probably prevents interception on the ErrorHandler class. Reason I would like to use this, is to adjust the ErrorHandler in a more developer friendly version (Whoops).

It makes sense, as the error handler needs to be registered before the object manager will be loaded. But, it would be great if there is a method to register another error_handler after that is done.

So basically it would be:

  • Register default Magento error handler
  • Load object manager
  • Register default Magento error handler again using object manager

The second moment would allow for interception I believe. Or, am I overseeing a method to register a different error_handler?

2 Comments
Not applicable

Comment from Vinai, posted on GitHub Feb 12, 2016

How about simply using set_error_handler?

Not applicable

Comment from stefandoorn, posted on GitHub Feb 12, 2016

Can do that, but that's quite late in the process then. Let's say I want the error from an erroneus di.xml also in my custom error handler, how would that work?