I have a recursive function in a BaseClass which relies on a protected virtual function for it's return condition.
It's possible for a child class to override this function incorrectly and leads to a StackOverFlow exception. The worst thing is there are some slow network calls and the exception is not gonna happen soon (many resources waste for a long time).
I'm looking for a method to check StackOverFlow in early stages some way in the base class (maybe using Reflection and the current recursion level).
Any idea ?