Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Handling exceptions

 
Pallav Grigo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone..a question about handling exceptions...should i call error.printStackTrace()() on the server and/or client side?? Or is it just better to display them a user-friendly message??
Regards,
Pallav.
 
Geir Morten Hagen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just finished my assignment, and I have handled exceptions in the layer where they logically occur. If an exception is thrown at the server side I just use Exception.getMessage() and print it to the console. When exceptions is thrown on the server, the exception should also be thrown in the remote object, and consequently they will be thrown on the client side. On the client side I've used JOptionPane.showMessageDialog() to present the user with "friendly" error messages.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!