Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. try
  2. {
  3. SomeAction();
  4. }
  5. catch(Exception _Ex)
  6. {
  7. if(_Ex is NullReferenceException)
  8. {
  9. DoSomething();
  10. }
  11. else if(_Ex is ArgumentOutOfRangeException)
  12. {
  13. DoSomethingElse();
  14. }
  15. }
  16.  
  17. try
  18. {
  19. SomeAction();
  20. }
  21. catch(NullReferenceException _Ex)
  22. {
  23. DoSomething();
  24. }
  25. catch(ArgumentOutOfRangeException _Ex)
  26. {
  27. DoSomethingElse();
  28. }
  29.  
  30. catch(Exception _Ex)
  31. {
  32. if(_Ex is NullReferenceException)
  33. {
  34. DoSomething();
  35. }
  36. else if(_Ex is ArgumentOutOfRangeException)
  37. {
  38. DoSomethingElse();
  39. }
  40. throw;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement