Skip to content

Commit b66de7b

Browse files
committed
feat: add ray id to error body
1 parent c93cc9a commit b66de7b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

fern/definition/common.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,6 @@ types:
105105
properties:
106106
code: string
107107
message: string
108+
ray_id: string
108109
documentation: optional<string>
109110
metadata: optional<ErrorMetadata>

lib/api-helper/build/src/error.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub struct ErrorReply {
1313
#[serde(skip_serializing_if = "Option::is_none")]
1414
pub code: Option<String>,
1515
pub message: String,
16+
pub ray_id: Uuid,
1617
#[serde(skip_serializing_if = "Option::is_none")]
1718
pub documentation: Option<String>,
1819
#[serde(skip_serializing_if = "Option::is_none")]
@@ -42,7 +43,7 @@ pub fn handle_rejection(
4243
} else {
4344
err_code!(
4445
ERROR,
45-
error = format!("An internal error has occurred (ray_id {}).", ray_id)
46+
error = "An internal error has occurred.",
4647
)
4748
}
4849
}
@@ -98,6 +99,7 @@ pub fn handle_rejection(
9899
let error_reply = ErrorReply {
99100
code,
100101
message,
102+
ray_id,
101103
documentation,
102104
metadata,
103105
};

0 commit comments

Comments
 (0)