Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement