Page MenuHomePhabricator

Add a lint check for catching "Exception" without catching "Throwable"
ClosedPublic

Authored by epriestley on Feb 3 2021, 10:42 PM.

Details

Summary

Ref T13588. For consistency of behavior between versions on either side of PHP7, any "catch (Exception)" block should generally have a "catch (Throwable)" block in the same catch list.

Raise a lint warning when "Exception" is caught without also catching "Throwable", since this is almost certainly not desired.

Test Plan

Added tests.

Diff Detail

Repository
rARC Arcanist
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.