HomePhabricator

Exception handler will now handle exceptions depending on their class

Authored by cesar on Apr 13 2020, 3:10 PM.

Description

Exception handler will now handle exceptions depending on their class

Summary:
The exception handler has become more generic, reducing it's dependency on classes inheriting from either PublicException or PrivateException

I've also shed some legacy, for example, the method now receives a Throwable object, this was an issue when we still supported PHP5, but now is no longer a problem. The code also doesn't catch it's own exception (if rendering the template goes wrong), the fatal error from the uncaught exception will be passed onto the error handler.

Test Plan:
Specific exceptions can now be addressed with the built-in exception handler.

For example, an exception of class test\IOException now gets rendered by the file bin/error_pages/test/IOException/default.php (the default can be swapped with the code of the specific exception)

Reviewers: sebastian

Reviewed By: sebastian

Differential Revision: https://phabricator.magic3w.com/D171

Details

Committed
cesarApr 13 2020, 3:11 PM
Pushed
cesarApr 13 2020, 3:11 PM
Reviewer
sebastian
Differential Revision
Restricted Differential Revision
Parents
rSFd41b682cff0d: Added events mk2 - Simpler and stronger
Branches
Unknown
Tags
Unknown

Event Timeline