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

Throwable.getSupprssed()

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


java.io.FileNotFoundException

Why i ain't getting any output for tt ?


My one regret in life is that I am not someone else.
- Woody Allen
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38788
    
  23
Have you read what Throwable#getSuppressed() actually does?
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Yes, it should print IOException that is suppressed in my program.
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


java.sql.SQLException

I have modified program.There is no "foo.in" file in my currentdirectory so there would be a FileNotFoundException cause by resources statement and getSuppressed() should get it, but didn't get any success. any help ?
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2286
    
  49
I suggest you read this article on suppressed exception handling.
 
Don't get me started about those stupid light bulbs.
 
subject: Throwable.getSupprssed()