-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
A clear and concise description of what the bug is and on which product (rum
, logs
).
As per the MDN specification, an error cause may not directly be an error:
The value of cause can be of any type. You should not make assumptions that the error you caught has an Error as its cause, in the same way that you cannot be sure the variable bound in the catch statement is an Error either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause.
They have an example where they provide structured data as the cause:
if (!Number.isInteger(p) || !Number.isInteger(q)) {
throw new Error("RSA key generation requires integer inputs.", {
cause: { code: "NonInteger", values: [p, q] },
});
}
flattenErrorCauses checks if the cause is of type error, meaning the MDN example of providing a code and values will not result in those attributes sent to DataDog.
Is this a bug or intended behaviour?
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
datadogRum.addError(new Error("RSA key generation requires integer inputs.", {
cause: { code: "NonInteger", values: [p, q] },
}))
Expected behavior
A clear and concise description of what you expected to happen.
Fields included in the cause which are not errors are shown in DataDog RUM.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working