Impossible to handle shell exceptions with shell(),
还没有人认领这个 Issue。
评估
调研方向
未指定源文件或测试。首先跟踪 shell() 的实现和 try() 的异常处理路径,然后检查 ShellException 如何填充其消息,以及 exception[1] 如何被公开。完成的标准是,shell 失败时能够通过文档所述的异常值获取命令的 stderr。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Java
- 星标
- 128
- 派生
- 70
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
EngineHub/CommandHelper 的其他 Issue
-
discussion wanted documentation
难度 5/5 一周以上 新手友好度 25/100
EngineHub/CommandHelper#1403 ·
-
难度 5/5 一周以上 新手友好度 25/100
EngineHub/CommandHelper#1370 · 1 条评论 ·
-
bug
难度 4/5 3-5 天 新手友好度 35/100
EngineHub/CommandHelper#1354 ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
EngineHub/CommandHelper#1349 · 3 条评论 ·
-
bug
难度 5/5 一周以上 新手友好度 25/100
EngineHub/CommandHelper#1341 · 2 条评论 ·
查看 EngineHub/CommandHelper 的全部 Issue
相似的 Issue
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
apache/rocketmq-dashboard#5064 ·