[SERVER-42667] Fix `ASSERT_THROWS` to avoid potentially catching unintended exceptions. Created: 07/Aug/19  Updated: 29/Oct/23  Resolved: 08/Aug/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Minor - P4
Reporter: ADAM Martin (Inactive) Assignee: ADAM Martin (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Dev Tools 2019-08-12
Participants:

 Comments   
Comment by Githook User [ 08/Aug/19 ]

Author:

{'name': 'ADAM David Alan Martin', 'username': 'adamlsd', 'email': 'adam.martin@10gen.com'}

Message: SERVER-42667 Make `ASSERT_THROWS` only catch exceptions from the expression.

The `FAIL(...)` invocation should be outside of the try/catch block for
this construct.
Branch: master
https://github.com/mongodb/mongo/commit/4297b3494a83fd59e60ac8141d2fbcb166966243

Generated at Thu Feb 08 05:01:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.