From fa5bba9e4537c643935494265798896e39fff845 Mon Sep 17 00:00:00 2001 From: Edwin Watkeys Date: Mon, 22 Oct 2018 23:50:59 +0000 Subject: Catch eval and send back eval exception information --- scheme/chibi/geiser/geiser.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'scheme') diff --git a/scheme/chibi/geiser/geiser.scm b/scheme/chibi/geiser/geiser.scm index 79a1b4e..96399c3 100644 --- a/scheme/chibi/geiser/geiser.scm +++ b/scheme/chibi/geiser/geiser.scm @@ -20,14 +20,15 @@ (define (geiser:eval module form . rest) rest - (let ((output (open-output-string)) - (result (if module - (let ((mod (module-env (find-module module)))) - (eval form mod)) - (eval form)))) - (write `((result ,(write-to-string result)) - (output . ,(get-output-string output)))) - (values))) + (guard (err (else (write `((result ,(show #f err)))))) + (let ((output (open-output-string)) + (result (if module + (let ((mod (module-env (find-module module)))) + (eval form mod)) + (eval form)))) + (write `((result ,(write-to-string result)) + (output . ,(get-output-string output)))))) + (values)) (define (geiser:module-completions prefix . rest) ;; (available-modules) walks the directory tree and is too slow -- cgit v1.2.3