rehack the argument formatting hack
svn: r14436
This commit is contained in:
parent
2cc94cbf02
commit
76c2d9eceb
|
@ -778,12 +778,15 @@
|
||||||
(if (and (null? args) (null? kws))
|
(if (and (null? args) (null? kws))
|
||||||
"no arguments supplied"
|
"no arguments supplied"
|
||||||
;; Hack to format arguments:
|
;; Hack to format arguments:
|
||||||
(with-handlers ([exn:fail?
|
(with-handlers
|
||||||
|
([exn:fail?
|
||||||
(lambda (exn)
|
(lambda (exn)
|
||||||
(format "arguments were: ~a"
|
;; the message can end with:
|
||||||
(cadr (regexp-match
|
;; ..., given: x; given 117 arguments total
|
||||||
#rx"other arguments were: (.*)$"
|
;; ..., given: x; other arguments were: 1 2 3
|
||||||
(exn-message exn)))))])
|
(regexp-replace #rx"^.*? given: x; (other )?"
|
||||||
|
(exn-message exn)
|
||||||
|
""))])
|
||||||
(apply
|
(apply
|
||||||
raise-type-error 'x "x" 0 'x
|
raise-type-error 'x "x" 0 'x
|
||||||
(append args (apply append (map list kws kw-args))))))])
|
(append args (apply append (map list kws kw-args))))))])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user