summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-04-30 05:49:07 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-04-30 05:49:07 +0300
commita4f37fb6683c332e09e597a6eb19d26f4005a08c (patch)
treecd70b3f5aaca076adbda50fccee2aeeea6c383f2 /modules
parenttests/tunnel.scm ("call-with-ssh-forward"): Wait for 1s before polling (diff)
downloadguile-ssh-a4f37fb6683c332e09e597a6eb19d26f4005a08c.tar.gz
node.scm (rrepl-get-result): Handle "unbound variable" errors
The procedure would always fail to read "unbound variable" errors properly, returning wrong result with only two values (current module name and current language name). Now this bug should be fixed. Reported by Mathieu, in <https://github.com/artyom-poptsov/guile-ssh/issues/3> * modules/ssh/dist/node.scm (rrepl-get-result): Handle "unbound variable" errors. * tests/dist.scm ("rrepl-get-result, unbound variable error"): New test case. * AUTHORS, NEWS: Update.
Diffstat (limited to 'modules')
-rw-r--r--modules/ssh/dist/node.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/ssh/dist/node.scm b/modules/ssh/dist/node.scm
index 247dd88..5174714 100644
--- a/modules/ssh/dist/node.scm
+++ b/modules/ssh/dist/node.scm
@@ -182,6 +182,12 @@ error."
(define %repl-error-regexp-2
(make-regexp "^ERROR: .*"))
+;; Regexp for parsing "unbound variable" errors.
+(define %repl-error-unbound-variable
+ (make-regexp "socket:[0-9]+:[0-9]+: \
+In procedure module-lookup: Unbound variable: .*"))
+
+
(define (rrepl-get-result repl-channel)
"Get result of evaluation form REPL-CHANNEL, return four values: an
evaluation result, a number of the evaluation, a module name and a language
@@ -227,7 +233,8 @@ name. Throw 'node-repl-error' on an error."
(define (error? line)
"Does a LINE contain an REPL error message?"
(or (regexp-exec %repl-error-regexp line)
- (regexp-exec %repl-error-regexp-2 line)))
+ (regexp-exec %repl-error-regexp-2 line)
+ (regexp-exec %repl-error-unbound-variable line)))
(define (error-message? result)
"Does a RESULT of evaluation contains a REPL error message?"