Address #330 by improving exception

This commit is contained in:
Sean Corfield 2021-06-17 12:54:15 -07:00
parent a2ee638b3b
commit 00b20f6bbf
2 changed files with 24 additions and 2 deletions

View file

@ -1,5 +1,8 @@
# Changes # Changes
* 2.0.next in progress
* Address #330 by improving exception when a non-entity is encountered where an entity is expected.
* 2.0.0-rc3 (for testing; 2021-06-16) * 2.0.0-rc3 (for testing; 2021-06-16)
* Fix #328 by adding `:distinct` as special syntax, affecting an expression. * Fix #328 by adding `:distinct` as special syntax, affecting an expression.
* Address #327 by changing "unknown clause" error to including mention of "nil values" (which are also illegal). * Address #327 by changing "unknown clause" error to including mention of "nil values" (which are also illegal).

View file

@ -151,8 +151,27 @@
(keyword (name s))) (keyword (name s)))
s)) s))
(defn- namespace-_ [x] (some-> (namespace x) (str/replace "-" "_"))) (defn- namespace-_
(defn- name-_ [x] (str/replace (name x) "-" "_")) "Return the namespace portion of a symbol, with dashes converted."
[x]
(try
(some-> (namespace x) (str/replace "-" "_"))
(catch Throwable t
(throw (ex-info (str "expected symbol, found: "
(type x))
{:symbol x
:failure (ex-message t)})))))
(defn- name-_
"Return the name portion of a symbol, with dashes converted."
[x]
(try
(str/replace (name x) "-" "_")
(catch Throwable t
(throw (ex-info (str "expected symbol, found: "
(type x))
{:symbol x
:failure (ex-message t)})))))
(defn- sqlize-value [x] (defn- sqlize-value [x]
(cond (cond