File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

throw an exception from UncaughtExceptionHandler

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I found one nice discussion here .

in my case, I need to throw Checked Exception from uncaughtException . but you cant throw any checked Exception since it is voilating the overriding rule . also uncaughtException not throwing any runtime exception .




any work around ?
 
Campbell Ritchie
Sheriff
Pie
Posts: 47258
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the interface doesn't declare an Exception, then you cannot declare any checked Exceptions in implementations. The intention of the method is to handle Exceptions without throwing anything else. The idea is that your implementation ought to be a refinement of the original method. So, every instance where the original method is feasible (ie runs without throwing an Exception) the implementation should be feasible (ie runs without Exceptions). You can fiddle it by throwing a RuntimeException or its subclasses. but that violates the spirit of refinement.

This is too difficult a subject for "beginning" so I shall move this thread.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Campbell
 
Campbell Ritchie
Sheriff
Pie
Posts: 47258
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic