• Post Reply Bookmark Topic Watch Topic
  • New Topic

Convert IOException to String?  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I don't understand what type the exception below is. I can print it out which makes me think of the exception as a string. However, if I try to save it to a string, I get the following compilation error:

How can I save this as a string?
 
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could do
 
Sheriff
Posts: 21201
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or Both can be what you want depending on what you want to be in the String exactly. The String returned by toString() includes the exception's class name and the message, unless it's null. getMessage() only returns the message, and that can be null.
 
Crusading Chameleon likes the size of this ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!