jextract: Preserve underlying exception when async closure completes exceptionally

オープン
#915 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, swift
領域
devtools

調査の方向性

Java の async closure から例外を捕捉する Swift thunk から始め、exceptional completion が Java future にどのように伝播されるかを追跡します。issue の RuntimeException ケースを再現し、基礎となる例外が cause として保持され、generic Exception に置き換えられていないことを確認します。

索引モデルが issue の本文から書いたものです。

説明

When a Java async closure completes exceptionally (e.g. with RuntimeException), the error is currently caught in the Swift thunk and completed exceptionally on the Java future as a generic Exception:

Future<Void> future = MySwiftLibrary.asyncScheduleThrowing(() -> {
    CompletableFuture<Void> failed = new CompletableFuture<>();
    failed.completeExceptionally(new RuntimeException("Java async failed"));
    return failed;
});

assertThrows(ExecutionException.class, future::get);

Optimally, we should unwrap the ExecutionException in the Swift thunk and rethrow/preserve the underlying RuntimeException as the cause rather than wrapping it in a generic Exception.

主要言語
Swift
スター
1.3k
フォーク
127
平均マージ
2日 14時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

swiftlang/swift-java のほかの issue

swiftlang/swift-java の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。