Skip to content

Commit 6524113

Browse files
committed
hotfix: Show request ID in internal error message
1 parent 9b5b452 commit 6524113

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

crates/game_api/src/configure.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub async fn mask_internal_errors(
8989
"[{request_id}] Got an internal error when processing a request: {err}"
9090
);
9191

92-
send_internal_err_msg_detached(client.0, head, err);
92+
send_internal_err_msg_detached(client.0, head, request_id, err);
9393

9494
let new_err = TracedError {
9595
error: ApiErrorKind::Lib(records_lib::error::RecordsError::MaskedInternal).into(),
@@ -114,6 +114,7 @@ pub async fn mask_internal_errors(
114114
pub(crate) fn send_internal_err_msg_detached<E>(
115115
client: reqwest::Client,
116116
head: actix_http::RequestHead,
117+
request_id: RequestId,
117118
err: E,
118119
) where
119120
E: fmt::Display + fmt::Debug,
@@ -125,11 +126,18 @@ pub(crate) fn send_internal_err_msg_detached<E>(
125126
title: "Request".to_owned(),
126127
description: None,
127128
color: 5814783,
128-
fields: Some(vec![WebhookBodyEmbedField {
129-
name: "Head".to_owned(),
130-
value: format!("```\n{}\n```", FormattedRequestHead::new(&head)),
131-
inline: None,
132-
}]),
129+
fields: Some(vec![
130+
WebhookBodyEmbedField {
131+
name: "Head".to_owned(),
132+
value: format!("```\n{}\n```", FormattedRequestHead::new(&head)),
133+
inline: None,
134+
},
135+
WebhookBodyEmbedField {
136+
name: "Request ID".to_owned(),
137+
value: format!("```\n{}\n```", request_id),
138+
inline: None,
139+
},
140+
]),
133141
url: None,
134142
},
135143
WebhookBodyEmbed {

crates/game_api/src/graphql.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ async fn index_graphql(
5757
configure::send_internal_err_msg_detached(
5858
client.0.clone(),
5959
req.head().clone(),
60+
request_id,
6061
err,
6162
);
6263
105 // Unknown type

0 commit comments

Comments
 (0)