Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created September 7, 2019 17:00
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 IntegerMan/a62ecca2b6c55a20499ea76a14f6f3a4 to your computer and use it in GitHub Desktop.
Save IntegerMan/a62ecca2b6c55a20499ea76a14f6f3a4 to your computer and use it in GitHub Desktop.
try {
DoSomethingRisky();
} catch (InvalidOperationException ex) {
if (ex.Message.StartsWith("Cannot access the")) {
// Some specialized handling logic
} else {
throw ex; // We don't have a specific solution for this. Rethrow it (Don't do this)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment