-
Enhancement
-
Resolution: Fixed
-
P3
-
5.0
-
b81
-
x86
-
linux, windows_xp
Name: rmT116609 Date: 07/01/2004
A DESCRIPTION OF THE REQUEST :
Consider adding to IOException a constructor that supports exception chaining
conveniently (IOException( String, Throwable)).
JUSTIFICATION :
IOException seems to be basic or common enough to warrant supporting
exception chaining directly in the constructor.
(In my case, I'm writing an OutputStream subclass that operates on an underlying
stream. If a method on the underyling stream throws an exception, I wrap it in an
IOException specific to the calling method in my OutputStream subclass.
CUSTOMER SUBMITTED WORKAROUND :
Instead of:
throw new IOException( "higher-level message", e );
use
IOException temp = IOException( "higher-level message" );
temp.initCause( e );
throw temp;
(Incident Review ID: 282209)
======================================================================
A DESCRIPTION OF THE REQUEST :
Consider adding to IOException a constructor that supports exception chaining
conveniently (IOException( String, Throwable)).
JUSTIFICATION :
IOException seems to be basic or common enough to warrant supporting
exception chaining directly in the constructor.
(In my case, I'm writing an OutputStream subclass that operates on an underlying
stream. If a method on the underyling stream throws an exception, I wrap it in an
IOException specific to the calling method in my OutputStream subclass.
CUSTOMER SUBMITTED WORKAROUND :
Instead of:
throw new IOException( "higher-level message", e );
use
IOException temp = IOException( "higher-level message" );
temp.initCause( e );
throw temp;
(Incident Review ID: 282209)
======================================================================
- duplicates
-
JDK-6405072 IOException subclasses lacks some constructors
- Closed
- relates to
-
JDK-6405072 IOException subclasses lacks some constructors
- Closed
-
JDK-8282574 Cleanup unnecessary calls to Throwable.initCause() in jdk.compiler
- Resolved