fix(api): log internal handler errors
Tower-http's TraceLayer logged the failure status code but not the underlying error, leaving 500s opaque without curling the response body. Log the error from the internal() helper so server logs carry the actual cause (permission denied, query error, etc.). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -145,9 +145,11 @@ impl ApiError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn internal<E: std::fmt::Display>(e: E) -> ApiError {
|
fn internal<E: std::fmt::Display>(e: E) -> ApiError {
|
||||||
|
let message = e.to_string();
|
||||||
|
tracing::error!(error = %message, "internal handler error");
|
||||||
ApiError {
|
ApiError {
|
||||||
status: StatusCode::INTERNAL_SERVER_ERROR,
|
status: StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
message: e.to_string(),
|
message,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user