The C method of doing what you want is using the setjmp and longjmp functions.
#include <setjmp.h>
jmp_buf unwind_stack;
void
inner_function (void)
{
if (some_condition ()) {
lonjmp (unwind_stack, 1);
}
}
void
loop (void)
{
if (setjmp (unwind_stack) == 0) {
/* normal code, do whatever you need here. */
inner_function ();
} else {
/* code after longjmp is called. */
Serial.println ("whoops");
}
}
The C++ method uses try/catch exceptions (
http://www.cplusplus.com/doc/tutorial/exceptions/). I am unsure if exceptions are fully supported in the Arduino environment.
However, as others have said, you probably should restructure your code not to need exceptions. I tend to think you want to use state machines, where you have a bunch of variables that say what to do, and check those each time inside of loop. Perhaps reading and really understanding blink without a delay (the time to restart the function is a simple minded state machine) would be a start.