diff options
author | Mathieu Othacehe <m.othacehe@gmail.com> | 2018-12-06 11:11:04 +0900 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-01-17 14:04:25 +0100 |
commit | 133c401f774d803f92933e9cadb6791641913beb (patch) | |
tree | 061febdce714640ce2d26570f0d2c67c068f6fcf /gnu/installer.scm | |
parent | 3d0f6a055c366a5414c35262bb4b31c0f602fcd3 (diff) | |
download | guix-133c401f774d803f92933e9cadb6791641913beb.tar guix-133c401f774d803f92933e9cadb6791641913beb.tar.gz |
installer: Display an eventual backtrace in a page.
* gnu/installer.scm (installer-program): Write the backtrace in
"/tmp/last-installer-error" and pass the filename to installer-exit-error.
* gnu/installer/newt.scm (exit-error): Display the file passed above in a textbox.
Diffstat (limited to 'gnu/installer.scm')
-rw-r--r-- | gnu/installer.scm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gnu/installer.scm b/gnu/installer.scm index 586ed29a59..2f01d39d1a 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -333,16 +333,15 @@ selected keymap." #:steps steps)) (const #f) (lambda (key . args) - ((installer-exit-error current-installer) key args) - - ;; Be sure to call newt-finish, to restore the terminal into - ;; its original state before printing the error report. - (call-with-output-file "/tmp/error" - (lambda (port) - (display-backtrace (make-stack #t) port) - (print-exception port - (stack-ref (make-stack #t) 1) - key args))) + (let ((error-file "/tmp/last-installer-error")) + (call-with-output-file error-file + (lambda (port) + (display-backtrace (make-stack #t) port) + (print-exception port + (stack-ref (make-stack #t) 1) + key args))) + ((installer-exit-error current-installer) + error-file key args)) (primitive-exit 1))) ((installer-exit current-installer))))))) |