Skip to content

Commit 07877ab

Browse files
committed
chore(cubestore): Log query that produces error processing HTTP command
1 parent 3f58992 commit 07877ab

File tree

1 file changed

+11
-3
lines changed
  • rust/cubestore/cubestore/src/http

1 file changed

+11
-3
lines changed

rust/cubestore/cubestore/src/http/mod.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ impl HttpServer {
356356
});
357357
} else {
358358
cube_ext::spawn(async move {
359+
let command_query = match &command {
360+
HttpCommand::Query { query, .. } => Some(query.clone()),
361+
_ => None,
362+
};
359363
let res = HttpServer::process_command(
360364
sql_service.clone(),
361365
sql_query_context,
@@ -370,9 +374,13 @@ impl HttpServer {
370374
},
371375
Err(e) => {
372376
log::error!(
373-
"Error processing HTTP command: {}\n",
374-
e.display_with_backtrace()
375-
);
377+
"Error processing HTTP command: {}{}",
378+
e.display_with_backtrace(),
379+
match command_query {
380+
Some(query) => format!("\nWith query: '''\n{}\n'''", query),
381+
None => String::new(),
382+
},
383+
);
376384
HttpMessage {
377385
message_id,
378386
connection_id,

0 commit comments

Comments
 (0)