try { // operation one if (failed) { return; } // operation two if (failed) { return; } // operation three if (failed) { return; } } finally { // do something when failed }
// operation one if (failed) { goto when_failed; } // operation one if (failed) { goto when_failed; } // operation one if (failed) { goto when_failed; } when_failed: // do something when failed