I'm writeing a parser.
So I want to see in parser exception what happend and when (not only where).

(define (parse-item item)
   (with-handlers ([exn? (lambda (e) (raise (struct-copy exn e [message (format 
"At item ~a\n~a" item (exn-message e))])))])
         ....))

But this way I lose all exception types. Is there a way to change exception 
message, saving its type, except long copy/paste like
(with-handlers ([exn:fail:contract:arity? (raise (struct-copy 
exn:fail:contract:arity ...))]
                         [exn:fil:contract? (raise (struct-copy 
exn:fail:contract ...))]
                         ...) 
   ...)

?

-- 
Roman Klochkov
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to