Closed ShadowKnightMK4 closed 4 weeks ago
While it seems trivial enough. Ensuring invalid regex doesn't just silently fail isn't. I need to design a way or settle on a way to let the worker threads communicate this.
Closed. It's finished for now.
We've added a few new things thru.
OdinSearch.Search() now has another routine that lets the caller get notification if a worker thread crashes via a delegate callback.
There is a new internal class WorkerThreadExceptionCounter that tracks when the threads trigger fatal exceptions. (Currently only expect this when passing bad Regex and the Debug safety is off but there's a try catch there in the main part of the worker thread to log if something happens. If something is logged, that's when the delegate is called if set.
Note: While the internal class is not 100% finalized, it should be noted that it could change between releases. There's a reason it's set to be internal. It does pass the unit test built - one that feeds invalid regex with safeties off and on, and testing for expected results on the WorkerThreadCrashed and GetWorkerThreadException().
There's a public facing API to access this stuff.
OdinSearch.GetWorkerThreadException()
returns a read only dictionary to expose this.
there's also a bool property that will test if an exception was logged, WorkerThreadCrashed
Add RegEx option to the class library OdinSearch.
This Involves the following: ReservedUnused=8 -> is now RegexMode (may be renamed) - same value.
Add code to skip converting the normal wildcard way to be using this mode instead. The output will still be a regex class BUT we need to play a little defensive i.e. ensure a timeout and catch exceptions if the user provides invalid reg.