[CSHARP-4803] Refactor StringExpressionToRegexFilterTranslator.TryTranslate to not use an exception for flow control when possible Created: 27/Sep/23  Updated: 28/Oct/23  Resolved: 05/Oct/23

Status: Closed
Project: C# Driver
Component/s: LINQ3
Affects Version/s: 2.21.0
Fix Version/s: 2.22.0

Type: Improvement Priority: Unknown
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-4811 Linux /.Net 7 / mongodb.driver.core.2... Closed
Backwards Compatibility: Fully Compatible
Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

The implementation of TryTranslate uses an exception for flow control.

Refactor so that no exceptions are thrown and caught in the case where TryTranslate returns false.



 Comments   
Comment by Githook User [ 05/Oct/23 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-4803: Refactor StringExpressionToRegexFilterTranslator.TryTranslate to not use an exception for flow control when possible.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/c1e3424141f1d8b6d10934c30dc8099b843e0381

Comment by Robert Stam [ 02/Oct/23 ]

> We need to help the client avoid this error. 

It is worth pointing out that there is NO error.

This is simply a possible optimization.

Comment by Omid Elyaskordi [ 02/Oct/23 ]

Per this help ticket: https://jira.mongodb.org/browse/HELP-50501

 

We need to help the client avoid this error. 

 

Here is the case as well: https://support.mongodb.com/case/01194194

Generated at Wed Feb 07 21:49:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.