HomeSealhub

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

Description

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

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.

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21542

Details

Provenance
epriestleyAuthored on Feb 3 2021, 23:25
kuba-orlikPushed on Jan 24 2022, 10:17
Parents
R118:c1afa91f9ff8: Annotate the unusual use of "$callback()" in "xsprintf()"
Branches
Unknown
Tags
Unknown

Event Timeline