Allow false; fail if too many components in vector given.
This commit is contained in:
parent
f25838a1eb
commit
417ae1ed92
1 changed files with 8 additions and 4 deletions
|
@ -504,7 +504,7 @@
|
||||||
(let [[op e a v tx] entity]
|
(let [[op e a v tx] entity]
|
||||||
[op e a v (or tx current-tx)]))
|
[op e a v (or tx current-tx)]))
|
||||||
|
|
||||||
(defn ensure-entity-form [[op e a v tx :as entity]]
|
(defn ensure-entity-form [[op e a v tx & rest :as entity]]
|
||||||
(cond
|
(cond
|
||||||
(not (sequential? entity))
|
(not (sequential? entity))
|
||||||
(raise "Bad entity " entity ", should be sequential at this point"
|
(raise "Bad entity " entity ", should be sequential at this point"
|
||||||
|
@ -514,18 +514,22 @@
|
||||||
(raise "Unrecognized operation " op " expected one of :db/add :db/retract at this point"
|
(raise "Unrecognized operation " op " expected one of :db/add :db/retract at this point"
|
||||||
{:error :transact/bad-operation :entity entity })
|
{:error :transact/bad-operation :entity entity })
|
||||||
|
|
||||||
(not e)
|
(nil? e)
|
||||||
(raise "Bad entity: nil e in " entity
|
(raise "Bad entity: nil e in " entity
|
||||||
{:error :transact/bad-entity :entity entity })
|
{:error :transact/bad-entity :entity entity })
|
||||||
|
|
||||||
(not a)
|
(nil? a)
|
||||||
(raise "Bad entity: nil a in " entity
|
(raise "Bad entity: nil a in " entity
|
||||||
{:error :transact/bad-entity :entity entity })
|
{:error :transact/bad-entity :entity entity })
|
||||||
|
|
||||||
(not v)
|
(nil? v)
|
||||||
(raise "Bad entity: nil v in " entity
|
(raise "Bad entity: nil v in " entity
|
||||||
{:error :transact/bad-entity :entity entity })
|
{:error :transact/bad-entity :entity entity })
|
||||||
|
|
||||||
|
(some? rest)
|
||||||
|
(raise "Bad entity: too long " entity
|
||||||
|
{:error :transact/bad-entity :entity entity })
|
||||||
|
|
||||||
true
|
true
|
||||||
entity))
|
entity))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue