Skip to content

Commit

Permalink
Improve unknown form error
Browse files Browse the repository at this point in the history
Add :type key and actual value of erroneous form
  • Loading branch information
mpenet authored and pyr committed Oct 1, 2019
1 parent 08ca0e0 commit c829a04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/seql/helpers.clj
Expand Up @@ -11,7 +11,9 @@
(doseq [{:keys [type context] :as form} (flatten forms)]
(when (or (nil? type) (nil? context))
(throw
(ex-info "Unknown form encountered" {})))
(ex-info "Unknown form encountered"
{:type ::unknown-form
:form form})))
(when-not (= context expected)
(throw
(ex-info (format "The %s form should be used inside %s definitions"
Expand Down

0 comments on commit c829a04

Please sign in to comment.