mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-08 14:02:55 +00:00
Show more detailed query errors from postgres_backend (#651)
anyhow uses the alternate formatting style ("{:#}") to display all of
the causes of an error instead of the outermost context.
Without this, there's less information available to figure out what's
going on. It's probably too much to display in the compute node logs
though, so it's better to leave that formatting as-is.
This commit is contained in:
@@ -377,7 +377,11 @@ impl PostgresBackend {
|
||||
// xxx distinguish fatal and recoverable errors?
|
||||
if let Err(e) = handler.process_query(self, m.body.clone()) {
|
||||
let errmsg = format!("{}", e);
|
||||
warn!("query handler for {:?} failed: {}", m.body, errmsg);
|
||||
// ":#" uses the alternate formatting style, which makes anyhow display the
|
||||
// full cause of the error, not just the top-level context. We don't want to
|
||||
// send that in the ErrorResponse though, because it's not relevant to the
|
||||
// compute node logs.
|
||||
warn!("query handler for {:?} failed: {:#}", m.body, e);
|
||||
self.write_message_noflush(&BeMessage::ErrorResponse(errmsg))?;
|
||||
}
|
||||
self.write_message(&BeMessage::ReadyForQuery)?;
|
||||
|
||||
Reference in New Issue
Block a user