diff options
author | Edwin Watkeys <edw@poseur.com> | 2018-10-22 23:50:59 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2018-11-11 19:03:19 +0000 |
commit | fa5bba9e4537c643935494265798896e39fff845 (patch) | |
tree | c4332ce85f02ef1114614d61cb05534b5a1b1c25 /scheme | |
parent | f9888bcf683dd4e66044d51bbf1b326dd4f8a7cb (diff) | |
download | geiser-guile-fa5bba9e4537c643935494265798896e39fff845.tar.gz geiser-guile-fa5bba9e4537c643935494265798896e39fff845.tar.bz2 |
Catch eval and send back eval exception information
Diffstat (limited to 'scheme')
-rw-r--r-- | scheme/chibi/geiser/geiser.scm | 17 |
1 files changed, 9 insertions, 8 deletions
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 |