Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 81be2a4

Browse files
authored
hrana: Properly catch stmt errors in batch (#748)
1 parent be73866 commit 81be2a4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sqld/src/hrana/http/request.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ async fn try_handle<D: Connection>(
7272
proto::StreamRequest::Batch(req) => {
7373
let db = stream_guard.get_db()?;
7474
let sqls = stream_guard.sqls();
75-
let pgm = batch::proto_batch_to_program(&req.batch, sqls, version)?;
75+
let pgm = batch::proto_batch_to_program(&req.batch, sqls, version)
76+
.map_err(catch_stmt_error)
77+
.map_err(catch_batch_error)?;
7678
let result = batch::execute_batch(db, auth, pgm, req.batch.replication_index)
7779
.await
7880
.map_err(catch_batch_error)?;

0 commit comments

Comments
 (0)