Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5070673

IOException should support exception chaining

XMLWordPrintable

    • 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)
      ======================================================================

            martin Martin Buchholz
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: