File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Exceptions ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Exceptions ??" Watch "Exceptions ??" New topic
Author

Exceptions ??

Gurpreet Saini
Ranch Hand

Joined: Jun 09, 2002
Posts: 295
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

Joined: May 15, 2002
Posts: 116
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.


Even crazy and silly looking problems are sometimes real.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451

any thoughts abut these opinions guys

That's a good explaination Parthi. I couldn't add a thing to it.
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exceptions ??
 
Similar Threads
Can't a page throw more that one exception?
gui with screenshot
Null pointer Exception in Basic List UI
Handling Exceptions
Doubt in K&B SCJP 6: topic: AssertionError Source