adjust browser-run to include any stderr message into the error dialog box

This commit is contained in:
Robby Findler 2017-05-23 08:45:54 -05:00
parent b36c35ac7e
commit ffe07718b8

View File

@ -302,9 +302,10 @@
;; Process helper ;; Process helper
(define (browser-run #:shell [shell? #f] . args) (define (browser-run #:shell [shell? #f] . args)
(define-values (stdout stdin pid stderr control) (define stderr (open-output-string))
(define-values (stdout stdin pid _stderr control)
(apply values (apply (if shell? process/ports process*/ports) (apply values (apply (if shell? process/ports process*/ports)
(open-output-nowhere) #f (current-error-port) (open-output-nowhere) #f stderr
args))) args)))
(close-output-port stdin) (close-output-port stdin)
;; this is called from plt-help which will immediately exit when we ;; this is called from plt-help which will immediately exit when we
@ -314,5 +315,7 @@
(thread (lambda () (thread (lambda ()
(control 'wait) (control 'wait)
(when (eq? 'done-error (control 'status)) (when (eq? 'done-error (control 'status))
(error 'browser-run "process execute failed: ~e" args))))) (error 'browser-run "process execute failed: ~e\n~a"
args
(get-output-string stderr))))))
(void)) (void))