zilch-cli-go: fix statusbar behavior on unhandled exceptions
This commit is contained in:
parent
5c22a25a24
commit
56ab2a7b71
1 changed files with 2 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
(import (scheme base) (scheme write) (zilch statusbar) (zilch nix daemon) (zilch magic) (zilch lib getopt) (scheme process-context) (chicken process-context) (srfi 146) (chicken port) (chicken foreign))
|
(import (scheme base) (scheme write) (zilch statusbar) (zilch nix daemon) (zilch magic) (zilch lib getopt) (scheme process-context) (chicken process-context) (srfi 146) (chicken port) (chicken foreign) (chicken condition))
|
||||||
(foreign-declare "#include <sched.h>")
|
(foreign-declare "#include <sched.h>")
|
||||||
(define get-cpu-count
|
(define get-cpu-count
|
||||||
(foreign-lambda* int ()
|
(foreign-lambda* int ()
|
||||||
|
|
@ -48,6 +48,7 @@ executables in the module, if unspecified)
|
||||||
|
|
||||||
;; Set up the logger.
|
;; Set up the logger.
|
||||||
(define (set-print-logs val) #f)
|
(define (set-print-logs val) #f)
|
||||||
|
(let ((prev-error-handler (current-exception-handler))) (current-exception-handler (lambda data (set-print-logs #t) (apply prev-error-handler data))))
|
||||||
(when (terminal-port? (current-error-port))
|
(when (terminal-port? (current-error-port))
|
||||||
(let-values (((new-out new-err statusbar-set-print-logs logger) (statusbar-logger (current-output-port) (current-error-port) (assoc 'print-build-logs options))))
|
(let-values (((new-out new-err statusbar-set-print-logs logger) (statusbar-logger (current-output-port) (current-error-port) (assoc 'print-build-logs options))))
|
||||||
(current-output-port new-out)
|
(current-output-port new-out)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue