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
F12850459: D21542.id51278.diff
Fri, Mar 29, 5:29 AM
Unknown Object (File)
Feb 17 2024, 6:52 AM
Unknown Object (File)
Feb 9 2024, 11:07 PM
Unknown Object (File)
Feb 4 2024, 12:39 AM
Unknown Object (File)
Jan 16 2024, 1:11 AM
Unknown Object (File)
Dec 30 2023, 11:54 PM
Unknown Object (File)
Dec 26 2023, 7:53 PM
Unknown Object (File)
Dec 25 2023, 8:26 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