Search code examples
c#exceptionthrow

C#: does 'throw' exit the current function?


If there is a throw statement in the middle of a function, does the function terminate at this point?


Solution

  • Yes, with the exception of any finally blocks, or if there is an exception handler within the function that can catch the type of exception you're throwing.