Welcome! Please see the About page for a little more info on how this works.

0 votes
in On-Prem by

Version

  • com.datomic/datomic-pro "1.0.6242"
  • transactor process 0.9.6045

Setup

Given the following transaction function definition:

(d/transact
 *conn*
 [{:db/ident :demo-throw-fn
   :db/fn (d/function
           {:lang "clojure"
            :params '[db]
            :code '(throw (ex-info "demo" {:type (type #{:one})}))})}])

Execute the transaction function in two environments:

  1. A local environment
  2. An environment where the transactor runs in a separate process

Expectation

Regardless of the environment, transaction function runtime errors are thrown.

Actual

  • In a local environment, execution of the demo function indeed throws an error - in line with expectations.
  • In an environment where the transactor runs in a separate process, the transactor times out.

Additional Notes

The hypothesis for the timeout is a second error occurs due to the
(type #{:one}) expression's result not being serializable. Unfortunately, the timeout error does not reveal what was likely known at some point during execution.

1 Answer

0 votes
by
selected by
 
Best answer

Hi David,

Thanks for the summary. I have noted that the error is not reported properly. This is a good candidate for a future enhancement.

Currently the recommendation (as you noted above) is to not return arbitrary things in the payload of the exception. Attempting to serialize arbitrary data will not be future functionality.

Welcome to the Datomic Knowledgebase, where you can make features requests, ask questions and receive answers from other members of the community.
...