Skip to content

Commit 9472bfc

Browse files
nipunn1313Convex, Inc.
authored andcommitted
Print the type of the error in the log (#41619)
Helpful to know if it's an occ or an operational or user error or something else. To help sort through logs. GitOrigin-RevId: 987983e375ad3c6473f49c951145825293d6ddce
1 parent b644010 commit 9472bfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/common/src/errors.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ fn trace_error(err: &mut anyhow::Error) {
133133
log_errors_reported_total(label);
134134
}
135135

136+
let label = err.metric_status_label_value();
136137
let err_for_tracing = format!("{err:#}").replace("\n", "\\n");
137138
tracing::error!(
138-
"Caught error (RUST_BACKTRACE=1 RUST_LOG=info,{}=debug for full trace): {err_for_tracing}",
139+
"Caught {label} error (RUST_BACKTRACE=1 RUST_LOG=info,{}=debug for full trace): \
140+
{err_for_tracing}",
139141
module_path!(),
140142
);
141143
tracing::debug!("{err:?}");

0 commit comments

Comments
 (0)