phocoa icon indicating copy to clipboard operation
phocoa copied to clipboard

support registering error handler outside phocoa

Open parisholley opened this issue 9 years ago • 4 comments

example use case is when an application is built on PHP 5.5 and you want to register an error handler to suppress deprecation warnings in PHP 5.6 (currently phocoa prevents this from being captured).


This change is Reviewable

parisholley avatar Oct 03 '16 22:10 parisholley

So the strategy here is to have a userland handler that ONLY eats the deprecation errors, and let the rest flow-thru via phocoa? A "Chain of responsibility" pattern?


Reviewed 1 of 1 files at r1. Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

apinstein avatar Oct 04 '16 15:10 apinstein

Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


phocoa/framework/WFRequestController.php, line 62 at r1 (raw file):

        {
            // only handle exceptions we care about
            return;

I presume this change was made so that you can get ALL error firehose and proxy to previousHandler? So, great!

However... do we need to return a boolean here to be compliant w/interface? I see that you're checking the return value from previousHandler so I assume there must be some expectation w/r/t return val.


Comments from Reviewable

apinstein avatar Oct 04 '16 15:10 apinstein

correct, you typically don't want a error handler taking over everything without attempting to invoke the previous chain


Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion.


phocoa/framework/WFRequestController.php, line 62 at r1 (raw file):

Previously, apinstein (Alan Pinstein) wrote…

I presume this change was made so that you can get ALL error firehose and proxy to previousHandler? So, great!

However... do we need to return a boolean here to be compliant w/interface? I see that you're checking the return value from previousHandler so I assume there must be some expectation w/r/t return val.

updated to return false

Comments from Reviewable

parisholley avatar Oct 04 '16 16:10 parisholley

:lgtm: presuming you've tested that exception reporting via phocoa still works / rollbar still captures things


Reviewed 1 of 1 files at r2. Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

apinstein avatar Oct 04 '16 16:10 apinstein