mirror of
https://github.com/nushell/nushell
synced 2025-01-13 13:49:21 +00:00
Fix LAST_EXIT_CODE
not being set for internal errors (#13954)
# Description Fixes #13949 where `$env.LAST_EXIT_CODE` was not being set for internal errors. # Tests + Formatting Cannot test due to limitations with the `nu_repl` test bin.
This commit is contained in:
parent
1d6ac16530
commit
475aa4f1dd
1 changed files with 2 additions and 0 deletions
|
@ -286,6 +286,8 @@ impl Stack {
|
|||
pub fn set_last_error(&mut self, error: &ShellError) {
|
||||
if let Some(code) = error.external_exit_code() {
|
||||
self.set_last_exit_code(code.item, code.span);
|
||||
} else {
|
||||
self.set_last_exit_code(1, Span::unknown());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue