The exception handler _js_exception_handler() expects an argument of type Exception, but in php 7 most exceptions thrown are of type Error, so if an exception is thrown during the js callback, it attempts to be handled by this function, but then throws an error like Argument 1 must be an instance of Exception, instance of Error given.
In PHP 7, both Exception and Error extend Throwable, so the type hint could be changed to that, but I believe that wouldn't be compatible with pre-7. The type hint could also be removed.
See http://php.net/manual/en/function.set-exception-handler.php
Comments
Comment #2
goron commentedComment #3
scottatdrake commentedI ran into this issue as well. Attaching a patch that removes the type hint.
Comment #4
alex.bukach commentedWorks fine for me!
Comment #5
markhalliwellThanks for the patch! I actually went ahead and added proper support for this so it will actually catch both as well.