Stacktrace

当命令代码中出现异常时,该异常会被外壳程序捕获,并显示一条简单的一行消息,以免用过多的信息淹没用户。不过,有些情况下,理解到底发生了什么非常重要(尤其是在异常具有嵌套原因时)。

When an exception occurs inside command code, it is caught by the shell and a simple, one-line message is displayed so as not to overflow the user with too much information. There are cases, though, when understanding what exactly happened is important (especially if the exception has a nested cause).

为此,Spring Shell 记住出现的最后一个异常,用户以后可以使用 stacktrace 命令在控制台上打印所有详细信息。

To this end, Spring Shell remembers the last exception that occurred, and the user can later use the stacktrace command to print all the details on the console.