Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ThrowSpecificExceptions code finding: Revise finding message and docu…
…mentation. Although I agree with the recommendation, the current wording always gives me pause, because it focuses on a situation that often does not apply when the finding comes up: an expectation for the exception to be caught. We should not assume that all code is library code, and catching a base exception type with intent to handle a specific exception is a problematic practice that should be detected anyway, so having this finding as a purely defensive practice is questionable. However, in light of the readability benefit, this finding is justified. So I've tried to update the finding text to avoid emphasis on the defensive justification, and to provide simple guidance in either case. My hope is that the finding text is sufficient to remind the reader of the check's justifications (defensive and clarity) and leave thorough explanation to the documentation. PiperOrigin-RevId: 321970137
- Loading branch information