• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the principle to handle the exception

 
Zee Ho
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rancchers, My thought of handling the exception is

in the front-end, for any exception occurs, using JDialog to prompt that what has happed, for the back-end, using the java logging to log all the exception to a file rather than throw them out.

is it a proper way, or just use System.out.println to simply show them in the console?
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the front-end, for any exception occurs, using JDialog to prompt that what has happed, for the back-end, using the java logging to log all the exception to a file rather than throw them out.
That is how I handled it, logging it at the appropriate level and then using a static method in one of my GUI classes to display a meaningful error message to the user.
 
Zee Ho
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx, so no one use the System.out.println to handle exception, right?
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!