aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgscm/init.scm
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-09-19 15:19:00 +0000
committerJustus Winter <[email protected]>2016-09-19 16:49:17 +0000
commitab483eff9a8254adf127cdee178e14ba74f0a2b3 (patch)
tree254dda8512ccdbcdad53ee3089766010f34893d7 /tests/gpgscm/init.scm
parenttests: Use descriptive temporary file names. (diff)
downloadgnupg-ab483eff9a8254adf127cdee178e14ba74f0a2b3.tar.gz
gnupg-ab483eff9a8254adf127cdee178e14ba74f0a2b3.zip
tests: Refine exception handling.
* tests/gpgscm/init.scm (catch): Bind all arguments to '*error*' in the error handler, update and fix comment. (*error-hook*): Revert to original definition. * tests/gpgscm/tests.scm (tr:do): Adapt accordingly. * tests/openpgp/issue2419.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/gpgscm/init.scm')
-rw-r--r--tests/gpgscm/init.scm10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/gpgscm/init.scm b/tests/gpgscm/init.scm
index b32172b12..f8fd71a1b 100644
--- a/tests/gpgscm/init.scm
+++ b/tests/gpgscm/init.scm
@@ -544,13 +544,14 @@
;
; "Catch" establishes a scope spanning multiple call-frames until
; another "catch" is encountered. Within the recovery expression
-; the thrown exception is bound to *error*.
+; the thrown exception is bound to *error*. Errors can be rethrown
+; using (apply throw *error*).
;
; Exceptions are thrown with:
;
; (throw "message")
;
-; If used outside a (catch ...), reverts to (error "message)
+; If used outside a (catch ...), reverts to (error "message")
(define *handlers* (list))
@@ -573,13 +574,12 @@
(macro (catch form)
(let ((label (gensym)))
`(call/cc (lambda (**exit**)
- (push-handler (lambda (*error*) (**exit** ,(cadr form))))
+ (push-handler (lambda *error* (**exit** ,(cadr form))))
(let ((,label (begin ,@(cddr form))))
(pop-handler)
,label)))))
-(define (*error-hook* . args)
- (throw args))
+(define *error-hook* throw)
;;;;; Definition of MAKE-ENVIRONMENT, to be used with two-argument EVAL