Page MenuHomePhabricator

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

Authored by epriestley on Feb 3 2021, 10:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 3:26 AM
Unknown Object (File)
Sat, Apr 20, 5:32 PM
Unknown Object (File)
Tue, Apr 16, 1:08 PM
Unknown Object (File)
Wed, Apr 10, 3:31 PM
Unknown Object (File)
Thu, Apr 4, 3:53 PM
Unknown Object (File)
Mon, Apr 1, 4:00 PM
Unknown Object (File)
Sat, Mar 30, 9:50 AM
Unknown Object (File)
Fri, Mar 29, 5:29 AM
Subscribers
None

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
Branch
lint4
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 25091
Build 34623: Run Core Tests
Build 34622: arc lint + arc unit