This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

identify exception

 
Ritesh raushan
Ranch Hand
Posts: 100
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my problem is that....at the time of developing application we don't pass (anyintnumber/0) then no exception occurs because i didn't think about that but when

i deploy the application my client enter (anyintnumber/0) and exception occurs.....

at the time of developing how will i know that if user enter anyintnumber/o exception occurs...

any mechanism for checking or it's depend on developer to think about that then it's very big burden on programmer.....


 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ritesh raushan wrote:any mechanism for checking or it's depend on developer to think about that then it's very big burden on programmer.....

That's exactly one of the reasons why programming is hard. If you're the developer, you have to think carefully about what happens with any input given to the program.
 
nir sharma
Ranch Hand
Posts: 72
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it depends on you how you plug those loop holes that can cause you application to fail, you cannot expect user to enter only definite set of values when there is not restriction. User intentionally or unintentionally can enter any figure, its up to you how you handle it.
In the example mentioned, you can even match whether its a number or not before parsing it.

Regards
Nir
 
Nikhil Sagar
Ranch Hand
Posts: 216
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i deploy the application my client enter (anyintnumber/0) and exception occurs.....

This is why we call them exceptions.
You can expect them at run time but nothing is guaranteed, an exception may or may not occur at run time.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic