So testing out PHP 7 I triggered an \EngineException() in Drupal 8. For
various reasons that don't really matter here Drupal uses
set_exception_handler() to provide its own exception handler. What is
important is that the methods used by that handler type hint \Exception for
their arguments. The immediately fatals.

By design, \EngineException does not extend \Exception so code doesn't
accidentally catch this special type of exception. Unfortunately they still
always make their way into this exception handler. Unfortunately this means
we have to remove the type hinting to support forward compatibility which
is a bit akward and unfortunate.

I don't know if this is all acceptable and/or by design but it is awkward
so I wanted to bring it to the list to discuss.

Simplified test case. Sorry for not putting it on 3v4l but its currently
unreachable.
https://gist.github.com/neclimdul/ab29ddb223cfc197e635

Reply via email to