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

Consider exposing cause information for IOException

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None

      There are consumers of java.io.IOException that have reason to want to know the underlying condition which caused the exception. For example, see the JRuby code

          https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/Ruby.java#L3964...L3996

      One way to encode such information would be with subtypes of IOException. However, exception types should be declared sparingly (https://blogs.oracle.com/darcy/entry/design_tips_exception_types), so a "getProblem" method or similar might be a better approach. The problem could be an enum or a wrapper around errno.

      Design complications includes the many subtypes of IOException and serialization.

            Unassigned Unassigned
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: