Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Should be easy, but need help.  RSS feed

 
Rob Levo
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need to write the result of printStackTrace method of the Exception class to a file.
Can someone provide an example. I am getting confused on what I/O classes to use.
Thanks,
Rob
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

or

If you wish to do anything with the stack trace other than write it to a file, you can convert it to a String:

And if you're using 1.4 (and why not?) you can use other methods:
 
Rob Levo
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jim Yingst:

or

If you wish to do anything with the stack trace other than write it to a file, you can convert it to a String:

And if you're using 1.4 (and why not?) you can use other methods:

Thanks for your quick and comprehensive reply that includes the 1.4 fuctionality.
Take care,
Rob
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!