Skip to content

Commit

Permalink
Handle lists in error->string in Gambit.
Browse files Browse the repository at this point in the history
  • Loading branch information
codecop committed Feb 14, 2019
1 parent 1f2a171 commit 2ac3eb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assert.scm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
(include "assert-r5rs.scm")

(define (-error->string ex)
(cond ((symbol? ex) (symbol->string ex))
(cond ((null? ex) "")
((string? ex) ex)
((symbol? ex) (symbol->string ex))
((list? ex) (string-append " (" (apply string-append (map -error->string ex)) ")"))
;; Gambit specific code
((error-exception? ex) (-error->string (error-exception-message ex)))
((unbound-global-exception? ex) (-error->string (unbound-global-exception-variable ex))) ; variable name
Expand Down

0 comments on commit 2ac3eb3

Please sign in to comment.