Answer the question
In order to leave comments, you need to log in
How to track Exception in all methods?
There is a device that returns an error, after which it needs to be reinitialized, an error can occur in different methods, but the error id is the same. How can the exception be handled globally, so as not to be written in catch in each method?
Answer the question
In order to leave comments, you need to log in
I would suggest something like TryGet pattern
https://stackoverflow.com/questions/37546622/best-...
Another option is a global catch that catches not only the exception, but also through reflection the method that was called.
Well, or a wrapper that takes a lambda and repeats it several times with exceptions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question