[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
49/80: installer: Wrap installer in (catch #t ...)
From: |
John Darrington |
Subject: |
49/80: installer: Wrap installer in (catch #t ...) |
Date: |
Tue, 3 Jan 2017 15:49:44 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 492aa1606bed2df20e59b666b5e6cffbd8592597
Author: John Darrington <address@hidden>
Date: Wed Dec 28 09:30:32 2016 +0100
installer: Wrap installer in (catch #t ...)
* gnu/system/installer/new.scm (guixsd-installer): Close the curses
display before showing backtrace on exceptions.
---
gnu/system/installer/new.scm | 73 ++++++++++++++++++++++++------------------
1 file changed, 42 insertions(+), 31 deletions(-)
diff --git a/gnu/system/installer/new.scm b/gnu/system/installer/new.scm
index a1e6275..ca280f4 100644
--- a/gnu/system/installer/new.scm
+++ b/gnu/system/installer/new.scm
@@ -230,34 +230,45 @@
(define-public (guixsd-installer)
-
- (define stdscr (initscr)) ; Start curses
-
- ;; We don't want any nasty kernel messages damaging our beautifully
- ;; crafted display.
- (system* "dmesg" "--console-off")
-
- (cbreak!) ; Line buffering disabled
- (keypad! stdscr #t) ; Check for function keys
- (noecho!)
-
- (start-color!)
-
- (init-pair! livery-title COLOR_RED COLOR_BLACK)
-
- (curs-set 0)
-
- (let ((page (make-page
- stdscr (gettext "GuixSD Installer")
- main-page-refresh main-page-key-handler)))
-
- (set! page-stack (cons page page-stack))
- ((page-refresh page) (car page-stack))
- (let loop ((ch (getch stdscr)))
- (let ((current-page (car page-stack)))
- ((page-key-handler current-page) current-page ch)
- (base-page-key-handler current-page ch))
- ((page-refresh (car page-stack)) (car page-stack))
- (loop (getch stdscr)))
-
- (endwin)))
+ (catch #t
+ (lambda ()
+
+ (define stdscr (initscr)) ; Start curses
+
+ ;; We don't want any nasty kernel messages damaging our beautifully
+ ;; crafted display.
+ (system* "dmesg" "--console-off")
+
+ (cbreak!) ; Line buffering disabled
+ (keypad! stdscr #t) ; Check for function keys
+ (noecho!)
+
+ (start-color!)
+
+ (init-pair! livery-title COLOR_RED COLOR_BLACK)
+
+ (curs-set 0)
+
+ (let ((page (make-page
+ stdscr (gettext "GuixSD Installer")
+ main-page-refresh main-page-key-handler)))
+
+ (set! page-stack (cons page page-stack))
+ ((page-refresh page) (car page-stack))
+ (let loop ((ch (getch stdscr)))
+ (let ((current-page (car page-stack)))
+ ((page-key-handler current-page) current-page ch)
+ (base-page-key-handler current-page ch))
+ ((page-refresh (car page-stack)) (car page-stack))
+ (loop (getch stdscr)))
+
+ (endwin)))
+ (lambda (key . args)
+ (system* "dmesg" "--console-on")
+ (exit 2))
+ (lambda (key subr message args rest)
+ (let ((s (make-stack #t 3 primitive-load)))
+ (endwin)
+ (display-backtrace s (current-error-port))
+ (display-error (stack-ref s 0)
+ (current-error-port) subr message args rest)))))
- 08/80: installer: Add IETF contraints for hostname in entry form., (continued)
- 08/80: installer: Add IETF contraints for hostname in entry form., John Darrington, 2017/01/03
- 12/80: installer: Add gurses modules., John Darrington, 2017/01/03
- 21/80: gnu: guix: Add dependency: guile-ncurses., John Darrington, 2017/01/03
- 17/80: installer: Add new procedure to get the list of volumes., John Darrington, 2017/01/03
- 19/80: installer: Handle the 'back' action in the filesystems task., John Darrington, 2017/01/03
- 23/80: installer: Fix incorrect host in ping task., John Darrington, 2017/01/03
- 25/80: installer: Use a cleaner way of generating the lspci information., John Darrington, 2017/01/03
- 24/80: installer: Make "interfaces" return an alist., John Darrington, 2017/01/03
- 27/80: installer: Connect ethernet interfaces on selection., John Darrington, 2017/01/03
- 28/80: installer: Let the kernel know about (possibly) changed partitions., John Darrington, 2017/01/03
- 49/80: installer: Wrap installer in (catch #t ...),
John Darrington <=
- 09/80: installer: Use a record instead of a list to contain tasks., John Darrington, 2017/01/03
- 29/80: installer: Deal with partition tables which are (partially) corrupt., John Darrington, 2017/01/03
- 37/80: installer: Improve dependencies on the final task., John Darrington, 2017/01/03
- 31/80: gnu: Add service to start the installer in installation-os., John Darrington, 2017/01/03
- 36/80: installer: Remove ad-hoc completed predicate and use standard one., John Darrington, 2017/01/03
- 35/80: installer: Make minumum-store-size variable global., John Darrington, 2017/01/03
- 34/80: installer: Add path to mount/umount commands in installer service., John Darrington, 2017/01/03
- 58/80: installer: Allow users to remove mount points during configuration., John Darrington, 2017/01/03
- 11/80: installer: Change "interfaces" from a variable to a procedure., John Darrington, 2017/01/03
- 14/80: installer: Add alternate method of finding TZDIR., John Darrington, 2017/01/03