Page MenuHomePhabricator

Pass all Throwables to Exception Handlers, not just Exceptions
ClosedPublic

Authored by epriestley on Jun 19 2017, 7:59 PM.
Tags
None
Referenced Files
F19915144: D18136.id43635.diff
Fri, Apr 3, 5:10 PM
F19903141: D18136.id.diff
Mon, Mar 30, 10:43 PM
F19811705: D18136.diff
Mar 4 2026, 2:14 AM
F19772694: D18136.diff
Feb 20 2026, 7:18 PM
F19685483: D18136.id.diff
Feb 9 2026, 8:47 AM
F19681556: D18136.id43649.diff
Feb 8 2026, 9:51 PM
F19076997: D18136.id43636.diff
Dec 1 2025, 2:10 PM
F19037699: D18136.diff
Nov 26 2025, 1:08 AM
Subscribers
None

Details

Summary

Ref T12855. PHP7 introduced "Throwables", which are sort of like super exceptions. Some errors that PHP raises at runtime have become Throwables instead of old-school errors now.

The major effect this has is blank pages during development under PHP7 for certain classes of errors: they skip all the nice "show a pretty error" handlers and

This isn't a compelete fix, but catches the most common classes of unexpected Throwable and sends them through the normal machinery. Principally, it shows a nice stack trace again instead of a blank page for a larger class of typos and minor mistakes.

Test Plan

Before: blank page. After:

Screen Shot 2017-06-19 at 12.51.23 PM.png (1×1 px, 277 KB)

Diff Detail

Repository
rP Phabricator
Branch
error1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 17528
Build 23516: Run Core Tests
Build 23515: arc lint + arc unit

Event Timeline

See T12855 for some discussion of why we can't typehint Throwable -- it doesn't exist in PHP5, and we can't write handleException(ExceptionIfPHP5|ThrowableIfPHP7 $ex)

src/aphront/handler/AphrontRequestExceptionHandler.php
15–19

This had no callers, so I remove it.

This revision is now accepted and ready to land.Jun 20 2017, 3:58 AM
This revision was automatically updated to reflect the committed changes.