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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -