guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#29922] [PATCH] linux-boot: Improve error reporting.


From: Danny Milosavljevic
Subject: [bug#29922] [PATCH] linux-boot: Improve error reporting.
Date: Mon, 1 Jan 2018 01:42:31 +0100

* gnu/build/linux-boot.scm (boot-system): Improve error reporting.
---
 gnu/build/linux-boot.scm | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 4dd740174..85c855e40 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -507,7 +507,23 @@ to it are lost."
              (switch-root "/root")
              (format #t "loading '~a'...\n" to-load)
 
-             (primitive-load to-load)
+             (catch #t
+               (lambda ()
+                 (primitive-load to-load))
+               (lambda (key . args)
+                 (format (current-error-port) "Error: ~a: ~a\n" key args)
+                 (reboot))
+               (lambda (key . args)
+                 (let ((print-frames
+                        (@@ (system repl debug) print-frames))
+                       (frame->stack-vector
+                        (@@ (system repl debug) frame->stack-vector))
+                       (stack-ref
+                        (@@ (system repl debug) stack-ref)))
+                   (print-frames
+                    (frame->stack-vector
+                     (stack-ref (make-stack #t) 0))
+                    #:width 1000000))))
 
              (format (current-error-port)
                      "boot program '~a' terminated, rebooting~%"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]