EngineHub / EngineHub/CommandHelper

Impossible to handle shell exceptions with shell(),

オープン
#1,022 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Java
スター
128
フォーク
70
PR マージ指標
30日以内にマージされた PR はありません

説明

CMDHELPER-3020 - Reported by VergilPrime

So lets say I run a command in shell(). Lets say the code is shell(@command).

I run it, something's wrong so it errors. I see "ShellException" in console, but not much else.

I want to see what the problem is so I do @output = shell(@command); sys_out(@output) to check to see what's going on. The problem is, because shell threw ShellException, sys_out(@output) will never run.

So lets say I'm a super smart cookie and I do try(@output = shell(@command), sys_out(@output)) so that sys_out() runs when shell() fails. @output is still empy.

One last thing we can try, try(shell(@command),@exception,sys_out(@exception[1])).

This should work because @exception "... is set to an array containing the following information about the exception: ... 1 - The message generated by the exception..."

and shell() "... throws a ShellException with the exception message set to the syserr output if the process exits with an exit code that isn't the expectedExitCode..."

Upon running this code we find that @exception[1] is empty.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

ソースファイルやテストは指定されていません。まず shell() の実装と try() の例外処理パスを追跡し、次に ShellException がメッセージをどのように設定するか、また exception[1] がどのように公開されるかを調べてください。shell の失敗によって、ドキュメント化された例外値を通じてコマンドの stderr が利用できるようになれば完了です。

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

評価

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

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

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