I wrap a large number of C ++ functions that can throw an exception if the underlying socket connection is lost. Although I figured out how to wrap the "get the connection" function to restore the connection and / or try other available servers in the list, I cannot find a solution to create a try..except shell to provide 80 + C ++.
Any tips on how I can wrap all these C ++ functions in something like try_call() ? If it were pure python, I could just do something like this:
def try_call(fn, *args, **kwargs):
But obviously, I cannot pass these cython functions as python objects (or maybe I can?).
Or something like this in C ++:
TRY_CALL_OR_RECONNECT conn().proxy().getProject(projT, guid) END_TRY_CALL_OR_RECONNECT
jdi
source share