Skip to content

Instantly share code, notes, and snippets.

@benweidig
Created May 16, 2020 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benweidig/f3499514552e3047c5feaaf59536eb45 to your computer and use it in GitHub Desktop.
Save benweidig/f3499514552e3047c5feaaf59536eb45 to your computer and use it in GitHub Desktop.
try {
// might throw IOException
doWork();
doMoreWorkRequireingCleanup();
}
catch (IOException e) {
throw new RuntimeExcetpion(e)
}
finally {
// Will be called regardless of IOException
cleanup();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment