Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. try {
  2.  
  3. DoSomethingRisky();
  4.  
  5. } catch (InvalidOperationException ex) {
  6.  
  7. if (ex.Message.StartsWith("Cannot access the")) {
  8. // Some specialized handling logic
  9. } else {
  10. throw ex; // We don't have a specific solution for this. Rethrow it (Don't do this)
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement