use `raise-argument-error` instead of `error`

pull/5/head
Matthew Butterick 7 years ago
parent bde362af97
commit 59b95ec470

@ -151,11 +151,11 @@
(define+provide+safe (txexpr tag [attrs null] [elements null]) (define+provide+safe (txexpr tag [attrs null] [elements null])
((symbol?) (txexpr-attrs? txexpr-elements?) . ->* . txexpr?) ((symbol?) (txexpr-attrs? txexpr-elements?) . ->* . txexpr?)
(unless (txexpr-tag? tag) (unless (txexpr-tag? tag)
(error 'txexpr (format "This is not a txexpr-tag: ~v" tag))) (raise-argument-error 'txexpr "txexpr-tag?" tag))
(unless (txexpr-attrs? attrs) (unless (txexpr-attrs? attrs)
(error 'txexpr (format "This is not a list of txexpr-attrs: ~v" attrs))) (raise-argument-error 'txexpr "txexpr-attrs?" attrs))
(unless (txexpr-elements? elements) (unless (txexpr-elements? elements)
(error 'txexpr (format "This is not a list of txexpr-elements: ~v" elements))) (raise-argument-error 'txexpr "txexpr-elements?" elements))
(define result (cons tag (append (if (empty? attrs) empty (list attrs)) elements))) (define result (cons tag (append (if (empty? attrs) empty (list attrs)) elements)))
(unless (txexpr? result) (unless (txexpr? result)

Loading…
Cancel
Save