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)
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
Unknown Object (File)
Feb 17 2024, 6:52 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable