gash: Catch shell errors on Mes.

* gash/gash.scm (main) [mes]: Catch shell errors.
This commit is contained in:
Timothy Sample 2022-12-22 13:32:51 -06:00
parent a1794de9f6
commit 9c5af49c81
1 changed files with 7 additions and 1 deletions

View File

@ -140,7 +140,13 @@ There is NO WARRANTY, to the extent permitted by law.
(write-history HOME)
(newline)))
(else (exit (run-repl (current-input-port) parse?))))))))
(thunk)))
;; Mes exits abnormally if an exception is not caught.
(cond-expand
(mes (catch 'shell-error
thunk
(lambda args
(exit 1))))
(else (thunk)))))
(cond-expand
(mes (define (prompt) "$ "))