ExtraErrorData
Extracts all non-native attributes from the error object and attaches them to the event as extra data.
Import name: Sentry.extraErrorDataIntegration
This integration extracts all non-native attributes from the error object and attaches them to the event as extra data. If the error object has a .toJSON() method, the ExtraErrorData integration will run it to extract additional information.
Copied
import * as Sentry from "___SDK_PACKAGE___";
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [Sentry.extraErrorDataIntegration()],
});
import * as Sentry from "___SDK_PACKAGE___";
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [Sentry.extraErrorDataIntegration()],
});
<script>
// Configure sentryOnLoad before adding the Loader Script
window.sentryOnLoad = function () {
Sentry.init({});
if (Sentry.extraErrorDataIntegration) {
Sentry.addIntegration(Sentry.extraErrorDataIntegration());
}
};
</script>
<script
src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js"
crossorigin="anonymous"
></script>
<script
src="https://browser.sentry-cdn.com/7.118.0/extraerrordata.min.js"
integrity="sha384-8+jHSkkYmPGJyPgzKSl1DEB/wD+KvVtfEBK2pk1LkeeGoxpwtgLO+KnF6Cn5oNyT"
crossorigin="anonymous"
></script>
<script>
// Configure sentryOnLoad before adding the Loader Script
window.sentryOnLoad = function () {
Sentry.init({});
Sentry.lazyLoadIntegration("extraErrorDataIntegration").then(
(integration) => {
Sentry.addIntegration(integration());
},
);
};
</script>
<script
src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js"
crossorigin="anonymous"
></script>
<script
src="https://browser.sentry-cdn.com/10.57.0/bundle.tracing.min.js"
integrity="sha384-fm7orKrUHTJhAKcdqNq6Kb/0qIpMNYz3TbwoEoiA3hdbnHqSBhIqMAZ4XS09pCU5"
crossorigin="anonymous"
></script>
<script
src="https://browser.sentry-cdn.com/10.57.0/extraerrordata.min.js"
integrity="sha384-mizyRL0MvvnfUimoh7/N0HnMKDnLxCkEJzk4IWnFHiCl+6uSAOHIf6U7f63DRZwT"
crossorigin="anonymous"
></script>
<script>
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [Sentry.extraErrorDataIntegration()],
});
</script>
Type: number
Limit of how deep the object serializer should go. The default is 3. Anything deeper than the set limit will be replaced with standard Node.js REPL notation of [Object], [Array], [Function], or a primitive value.
Type: boolean
Indicates if the serializer should catch the cause of the error. The default is true. For more information, see the Error: cause MDN Web Docs.
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").