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

HttpClient: sendAsync throws unspecified exceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 26
    • core-libs

      `HttpClientImpl::send` transforms thrown exceptions to `IOException`'s, as documented in its spec:

           * @throws IOException if an I/O error occurs when sending or receiving, or
           * the client has {@linkplain ##closing shut down}

      `sendAsync()` has a similar spec:

           * <p> The returned completable future completes exceptionally with:
           * <ul>
           * <li>{@link IOException} - if an I/O error occurs when sending or receiving,
           * or the client has {@linkplain ##closing shut down}.</li>

      Yet it doesn't have this exception translation logic and propagates unchecked exceptions as is[1], which is against the spec.

      [1] https://github.com/openjdk/jdk/pull/26155#discussion_r2235104122

            vyazici Volkan Yazici
            vyazici Volkan Yazici
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: