Skip to content

Commit 77f67ce

Browse files
committed
fix error handling
1 parent 298c110 commit 77f67ce

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/clj/xt_play/handler.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
(s/def ::system-time (s/nilable string?))
2020
(s/def ::txs string?)
21-
(s/def ::query (s/nilable string?))
21+
(s/def ::query (s/or :string (s/nilable string?)
22+
:bool boolean?))
2223
(s/def ::tx-batches (s/coll-of (s/keys :req-un [::system-time ::txs] :opt-un [::query])))
2324
(s/def ::tx-type #{:sql-v2 :xtql :sql})
2425
(s/def ::db-run (s/keys :req-un [::tx-batches ::query]))

src/clj/xt_play/transactions.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
(let [elapsed-ms (Math/round (/ (- (System/nanoTime) start-time) 1000000.0))]
178178
(log/error "Exception while running transaction" (ex-message ex))
179179
[{:error {:message (ex-message ex)
180-
:exception (.getClass ex)
180+
:exception (.getName (.getClass ex))
181181
:data (ex-data ex)}
182182
:timing-ms elapsed-ms}])))))
183183
tx-batches))]
@@ -239,7 +239,7 @@
239239
(log/warn "Rolling back transaction")
240240
(xtdb/jdbc-execute! conn ["ROLLBACK"]))
241241
{:error {:message (ex-message ex)
242-
:exception (.getClass ex)
242+
:exception (.getName (.getClass ex))
243243
:data (ex-data ex)}}))))
244244
elapsed-ms (Math/round (/ (- (System/nanoTime) start-time) 1000000.0))]
245245
(when result

0 commit comments

Comments
 (0)