• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I Wonder How To Catch This Exception ?

 
Ranji Sura
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have got this code in my class. I have tried to catch the exception here, but i am still not able to do it so.. Could you please help me... ?

These are the methods which I have tried to catch the exception.. Non of them work in this case.. I don't know why... ?


Thank You.
 
Ranji Sura
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, Isn't this exception ? Is this an error... ?
 
Ranji Sura
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. I tried this and it works.. It is not an exception, It is an error, I think...


 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never catch Errors (unless you are simply seeing what happens if…).

I would rather say, “What Exception?” I can’t see anything which produces a bona fide Exception in your code.
You are recursively calling a method with no base case, so your recursion will go on for ever (or more precisely until you exhaust the available stack memory), but that is a different design mistake.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic