DdRum addError message being ommited
@marco-saia-datadog がすでに取り組んでいます。
2025年11月24日 から。
評価
この issue はまだ評価されていません。
説明
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
- 主要言語
- TypeScript
- スター
- 146
- フォーク
- 63
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 13
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DataDog/dd-sdk-reactnative のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
DataDog/dd-sdk-reactnative#1426 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
DataDog/dd-sdk-reactnative#1377 · コメント 1 件 · リアクション 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
DataDog/dd-sdk-reactnative#1353 · コメント 1 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
DataDog/dd-sdk-reactnative#1338 · コメント 2 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
DataDog/dd-sdk-reactnative#1327 ·
DataDog/dd-sdk-reactnative の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
TanStack/tanstack.com#1293 ·