这是我运行的代码和出现的错误:
jshell> myInstance.execSomething("./a.out")
| java.io.IOException thrown: ./a.out returned: 99:
| at myInstance.execSomething (MyProcessExecutor.java:109)
| at (#21:1)
我希望能够轻松捕获对IOException
的引用,因为我想避免使用封闭的try...catch
块重新运行/重写代码。
我检查了/vars
,但没有看到任何类型为IOException
的变量:
jshell> /vars
| List<String> args = []
| List<String> list = []
| Iterable<String> $11 = null
| Iterable<String> $12 = null
| MyProcessExecutor $16 = MyProcessExecutor[pid=85679, exitValue=99]
| Iterable<String> $20 = null
| Iterable<String> $21 = null
有快捷键吗?