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

Craig Johnston picture Craig Johnston · Mar 2, 2011 · Viewed 11.3k times · Source

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

Answer

Greg Hewgill picture Greg Hewgill · Mar 2, 2011

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.