diff --git a/docs/platforms/javascript/common/apis.mdx b/docs/platforms/javascript/common/apis.mdx index d5e3f44f68504..9d2a2486d8daa 100644 --- a/docs/platforms/javascript/common/apis.mdx +++ b/docs/platforms/javascript/common/apis.mdx @@ -239,6 +239,16 @@ more information on how to use integrations. only `Error` objects, but also other objects as `exception` - in that case, the SDK will attempt to serialize the object for you, and the stack trace will be generated by the SDK and may be less accurate. + + Please note that the serialization of objects may not be perfect, as it works based on simple heuristics. Objects that are not `Error` objects will be generally be serialized as follows: + + ```javascript + Sentry.captureException({ prop1: "value1", prop2: "value2" }); + // --> "Object captured as exception with keys: prop1, prop2" + ``` + + Note that built-in objects may be serialized differently. If you want to capture objects in a specific way, you can use the `captureContext` parameter to attach additional data to the event. + { -## Instrumenting Server Routes +## Instrumenting Server Routes