[Pkg-gnupg-commit] [gnupg2] 14/160: tests/gpgscm: Make exception value available.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Fri Jul 15 09:36:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch upstream
in repository gnupg2.
commit 3b100da9ada9171d873a796eaf3351d4fceed394
Author: Justus Winter <justus at g10code.com>
Date: Mon Feb 22 16:36:12 2016 +0100
tests/gpgscm: Make exception value available.
* tests/gpgscm/init.scm (throw): Hand exception value to the handler.
(catch): And bind it to *error*.
---
tests/gpgscm/init.scm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/gpgscm/init.scm b/tests/gpgscm/init.scm
index 630f27a..0889366 100644
--- a/tests/gpgscm/init.scm
+++ b/tests/gpgscm/init.scm
@@ -542,8 +542,9 @@
; (if-something goes-wrong)
; (with-these calls))
;
-; "Catch" establishes a scope spanning multiple call-frames
-; until another "catch" is encountered.
+; "Catch" establishes a scope spanning multiple call-frames until
+; another "catch" is encountered. Within the recovery expression
+; the thrown exception is bound to *error*.
;
; Exceptions are thrown with:
;
@@ -566,13 +567,13 @@
(define (throw . x)
(if (more-handlers?)
- (apply (pop-handler))
+ (apply (pop-handler) x)
(apply error x)))
(macro (catch form)
(let ((label (gensym)))
`(call/cc (lambda (exit)
- (push-handler (lambda () (exit ,(cadr form))))
+ (push-handler (lambda (*error*) (exit ,(cadr form))))
(let ((,label (begin ,@(cddr form))))
(pop-handler)
,label)))))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list