File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exceptions ??

 
Gurpreet Saini
Ranch Hand
Posts: 295
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi reader,
My prgram is notifying the user with every detail of error or exception to user. But I am still not clear avout the spec. which states handle all the errors. Please tell me is it saying about Error class or simple errors / problems which user may encounter. My showDailogMesage appears like this way:
suncertify.db.exception.DatabaseLockedException:
Database has locked
The path of DatabaseException is visible to user. Is this OK or shall I change to simple message.
Secondly, I had documented all the exceptions whcih user can encounter. Is it appropriate to tell user if Nullpointer or Remote exceptions occurs then what troubleshooting mechanism you should use. I am giving stress over the exceptions which I had mentioned above. Shall I document them as Nullpointer and RemoteException etc ?.
Thank you,
Gurpreet
 
parthiban subramaniam
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi gurpreet,
i dont think mentioning of the exception which occured to the user is a good idea .. just meaning full message will do ..
in this case just daatabase is locked will do(make it nice and meaningfull not like ms exceptions )
null pointers are errors due to bugs present they shuld not happen (well thats is my view)and it does not make any sense to the user who is using the system...
for example if the results obtained by the criteria search is a empty datainfo or a null and you get a null pointer when u try to handle it .. this nulpointer exception shuld not be reported to the user but the programe shuld handle it and display apropritae messages .. in this case no results found (chk for null b'fore you perform anything with a object if a method can return null or a result)
remote exception again does not mean anything to the user..if the controller has lost the remote connection due to remote server going down .. reporting a remote exception does not make any sense to the user where as asking him to try and connect again b'cos of the remote database goin down does ..
any thoughts abut these opinions guys
hope this helps
cheers,
parthi.
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

any thoughts abut these opinions guys

That's a good explaination Parthi. I couldn't add a thing to it.
Michael Morris
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic