DdRum addError message being ommited
Maintainer thường phản hồi trong vòng 1 ngày
@marco-saia-datadog đang làm issue này rồi.
Từ ngày 24/11/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Describe the bug
While using DdRum.addError to send errors to Datadog, under some conditions the error message is replaced by the stack trace.
From empirical testing, I noticed that these conditions happen when the stack trace parameter starts with some words and a colon. Then the error message is replaced with what's after the colon in the stack trace.
Reproduction steps
From the errors below, the only ones that I can see the error message on Datadog are the 2nd and 4th messages.
// Error stack will start with "Error:", so message is replaced with stack trace
try {
throw new Error("my test error 1");
} catch (e) {
void DdRum.addError(
"Error: my 1st message",
ErrorSource.CUSTOM,
(e as Error).stack ?? "empty stack",
{
a: 1,
}
);
}
// If a regular string is placed in the stack trace parameter, it works fine!
void DdRum.addError(
"Error: my 2nd message",
ErrorSource.CUSTOM,
"my 2nd stack info",
{
a: 2,
}
);
// If stack trace param has a colon, error message is replaced! Not exclusive for Error objects
void DdRum.addError(
"Error: my 3rd message",
ErrorSource.CUSTOM,
"Error: my 3rd stack info",
{
a: 3,
}
);
// Works fine if I add a linebreak before the stack trace (my current workaround)
try {
throw new Error("my test error 4");
} catch (e) {
void DdRum.addError(
"Error: my 4th message",
ErrorSource.CUSTOM,
"\n" + ((e as Error).stack ?? "empty stack"),
{
a: 4,
}
);
}
// Issue not exclusive to "Error:", any work preceding a colon will have the same effect
void DdRum.addError(
"Error: my 5th message",
ErrorSource.CUSTOM,
"ABCD: my 5th stack info",
{
a: 5,
}
);
SDK logs
No response
Expected behavior
No response
Affected SDK versions
2.4.0
Latest working SDK version
NA
Did you confirm if the latest SDK version fixes the bug?
Yes
Integration Methods
Yarn
React Native Version
0.73.6
Package.json Contents
"@datadog/mobile-react-native": "^2.4.0"
iOS Setup
No response
Android Setup
No response
Device Information
No response
Other relevant information
No response
- Ngôn ngữ chính
- TypeScript
- Star
- 146
- Fork
- 63
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DataDog/dd-sdk-reactnative
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
DataDog/dd-sdk-reactnative#1426 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
DataDog/dd-sdk-reactnative#1377 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
DataDog/dd-sdk-reactnative#1353 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
DataDog/dd-sdk-reactnative#1338 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
DataDog/dd-sdk-reactnative#1327 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DataDog/dd-sdk-reactnative
Issue tương tự
-
docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
remix-run/react-router#15558 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
solana-foundation/pay-kit#341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
supabase/agent-skills#607 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày