Exceptions Listeners Priority
anatolykhelmer opened this issue · 3 comments
What ZF application I'm using when issue happen ?
- ^ZF2.5
- ^ZF3
- Expressive 1
- Expressive 2
- Expressive 3
What PHP version you're using?
- PHP 5.6
- PHP 7.0
- PHP 7.1
- PHP 7.2
Expected behavior
It would be very nice if all error listeners were attached with last possible priority to allow the exceptions to be catched by other listeners. For example ZfcRbac throws Unauthorized exception and catches it by itself. I think that error-hero-module should be attached to catch exceptions that otherwise would be probably not catched at all.
Actual behavior
It attaches listeners with default priority.
Steps/Codes to reproduce the behavior
For example, you can install ZfcRbac and all Unauthorized exceptions will be catched by error-hero-module.
If you have the exceptional Exception to exclude, you can register it under exclude-exceptions
under display-settings
configuration.
Yes, I know and I use it. But if I somehow "forgot" to catch the exception, error-hero-module should catch it and log it, but it won't do it because it configured as "exclude-exceptions". I think that the philosophy of the error-hero-module is to be a "last barrier".
No, exception should be catched early, when the exception is excluded, it will rely to mvc process, so you need to handle it in the application part or if there is a part at ZfcRbac that handle it ( I’m not using ZfcRbac ).