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

IOException should support exception chaining

    Details

    • Subcomponent:
    • Resolved In Build:
      b81
    • CPU:
      x86
    • OS:
      linux, windows_xp

      Description

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: