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:
Ian Manske 2024-10-02 04:00:50 -07:00 committed by GitHub
parent 1d6ac16530
commit 475aa4f1dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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());
}
}