asp.net - Custom Exception class doesn't work -


why classes inerithes system.exception don't work in try catch block?

the following snipped doesn't fire catch block

try {     int = 3;     int b = 0;     int c = a/b; } catch (customex er) {       console.write(er.message); }  public class  customex:exception {  } 

the code provided cannot work because division throws dividebyzeroexception , you're catching customex inherits exception not dividebyzeroexception.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -