minor tweaks

This commit is contained in:
Jeff Raymakers
2025-06-03 09:04:39 -07:00
parent 6145a1b4a9
commit c7d73dcb8d

View File

@@ -385,8 +385,7 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
// If there's more than one statement, run all but the last. // If there's more than one statement, run all but the last.
if (statement_count > 1) { if (statement_count > 1) {
for (auto i = 0; i < statement_count - 1; ++i) { for (auto i = 0; i < statement_count - 1; ++i) {
auto &statement = statements[i]; auto pending = connection->PendingQuery(std::move(statements[i]));
auto pending = connection->PendingQuery(std::move(statement));
// Return any error found before execution. // Return any error found before execution.
if (pending->HasError()) { if (pending->HasError()) {
SetResponseErrorResult(res, pending->GetError()); SetResponseErrorResult(res, pending->GetError());
@@ -412,7 +411,9 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
pending->Execute(); pending->Execute();
break; break;
default: default:
SetResponseErrorResult(res, "Unexpected PendingExecutionResult"); SetResponseErrorResult(
res, StringUtil::Format("Unexpected PendingExecutionResult: %d",
exec_result));
return; return;
} }
} }
@@ -488,7 +489,9 @@ void HttpServer::DoHandleRun(const httplib::Request &req,
break; break;
} }
default: default:
SetResponseErrorResult(res, "Unexpected PendingExecutionResult"); SetResponseErrorResult(
res, StringUtil::Format("Unexpected PendingExecutionResult: %d",
exec_result));
break; break;
} }
} }