JDK-4398872 : Throwable needs getWrappedException() method
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-12-16
  • Updated: 2001-07-11
  • Resolved: 2001-07-11
Related Reports
Duplicate :  
Description

Name: krC82822			Date: 12/16/2000


It is common practice among Java developers to wrap exceptions.  See the SAX
API's SaxException for an example.  If Throwable had a method
getNextException() or getWrappedException() or maybe getWrappedThrowable(),
it would make dealing with wrapped exceptions in a generic way very easy.

The default implementation in Throwable would return null.
So all we are asking for is three lines in java.lang.Throwable:

public Throwable getWrappedThrowable(){
  return null;
}


(or getWrappedException() equivalent)


(Review ID: 113916) 
======================================================================

Comments
WORK AROUND Name: krC82822 Date: 12/16/2000 weel you could do some reflection to look for a method that returns an exception but that's still a pain. ======================================================================
11-06-2004

EVALUATION This is being done for 1.4. The method is called getCause and the work is know as the "chained exception facility." joshua.bloch@Eng 2001-07-11
11-07-2001