Better error message for accidental objects in args to transaction functions

We accidentally ran into this error when sending a map that had a Datomic DB inside of it to a transaction function (but it’s the same with atoms, etc.). It’s logical that this wouldn’t work (the object would have to be serialized and put on the wire etc.), but the error message is not the greatest. It lead to some head-scratching.

Could this be asserted ahead of time and a clearer error issued?

Execution error at com.cognitect.transit.impl.AbstractEmitter/marshal (
Not supported: class clojure.lang.Atom
1 Like

Indeed, an earlier and more specific assert would be great if one accidentally makes this error :+1:

And perhaps an addition to the docs to explicitly state that the params to a tx fn needs to be pure data, never actual instantiated objects.