Is there any attribute that I can use, attached to the method definition, that will suppress any exceptions of a certain type originating in that method? e.g.
[SuppressException(typeof(TimeoutException))]
public void TroubleMethod()
{
}
So when there is a TimeoutException, it won’t throw outside of TroubleMethod?
You can use exception handling around the entire method:
I don’t think an attribute that does what you describe exists, though. If you want the debugger to step through your method, you can always use
[System.Diagnostics.DebuggerStepThrough()], but as for suppressing exceptions, I don’t think that’s possible.