samsonasik/ErrorHeroModule

Refactor to allow more fatal error logging

samsonasik opened this issue · 1 comments

Currently, some fatal error like :

Y cannot implement X - it is not an interface

still not logged. The code to reproduce is like below:

class X {}
class Y implements X { }

The fallback down of the error is on register_shutdown_function() call which when it is overlapped, it is not recorded by logging, as the code exited.

Integrating it into frameworks (zf-mvc and zf-expressive) is not as easy as imagined as it need to follow the dispatch flow.

The steps of refactor are as follow:

  1. move the display_errors check to early in process() or bootstrap event from the trait
  2. move the logging to phpErrorHandler() function
  3. "save" its flag "somewhere", and returns ( display as is ? ) Response instance.

It will require a big refactor, and I will do when I have a time ✌️

implemented at #54