mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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 <justus@g10code.com>
This commit is contained in:
parent
83a406b38a
commit
ab483eff9a
3 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue