GrayMP

Untitled

Dec 4th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2. // awkward way
  3. catch(Exception ex){
  4. if (ex is RudenSpecificException)
  5. {
  6. ((RudenSpecificException) ex).RudenMessage;
  7. }
  8. }
  9.  
  10. // fast way
  11. catch(Exception ex)
  12. {
  13. var rudenSpecific = ex as RudenSpecificException;
  14. if (rudenSpecific != null) rudenSpecific.Message; // not a big win in lines in this case, but you can use fields directly via one AS command
  15. }
Advertisement
Add Comment
Please, Sign In to add comment