Skip to content

Commit 37b453e

Browse files
committed
ref: Move extraErrorData from @sentry/core to @sentry/integrations
1 parent 051ce83 commit 37b453e

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export { Dedupe } from './dedupe';
22
export { FunctionToString } from './functiontostring';
33
export { InboundFilters } from './inboundfilters';
4-
export { ExtraErrorData } from './extraerrordata';

packages/core/src/integrations/extraerrordata.ts renamed to packages/integrations/src/extraerrordata.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { isError, isPlainObject } from '@sentry/utils/is';
44
import { logger } from '@sentry/utils/logger';
55
import { normalize } from '@sentry/utils/object';
66

7+
/** JSDoc */
8+
interface ExtraErrorDataOptions {
9+
depth?: number;
10+
}
11+
712
/** Patch toString calls to return proper name for wrapped functions */
813
export class ExtraErrorData implements Integration {
914
/**
@@ -16,6 +21,11 @@ export class ExtraErrorData implements Integration {
1621
*/
1722
public static id: string = 'ExtraErrorData';
1823

24+
/**
25+
* @inheritDoc
26+
*/
27+
public constructor(private readonly options: ExtraErrorDataOptions = { depth: 3 }) {}
28+
1929
/**
2030
* @inheritDoc
2131
*/
@@ -44,7 +54,7 @@ export class ExtraErrorData implements Integration {
4454
...event.extra,
4555
};
4656

47-
const normalizedErrorData = normalize(errorData);
57+
const normalizedErrorData = normalize(errorData, this.options.depth);
4858
if (isPlainObject(normalizedErrorData)) {
4959
extra = {
5060
...event.extra,

packages/core/test/lib/integrations/extraerrordata.test.ts renamed to packages/integrations/test/extraerrordata.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ExtendedError, SentryEvent } from '@sentry/types';
2-
import { ExtraErrorData } from '../../../src/integrations/extraerrordata';
2+
import { ExtraErrorData } from '../src/extraerrordata';
33

44
const extraErrorData = new ExtraErrorData();
55
let event: SentryEvent;

0 commit comments

Comments
 (0)