Skip to content

Commit

Permalink
ref: Move extraErrorData from @sentry/core to @sentry/integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Feb 26, 2019
1 parent a1412c5 commit 4d11eb3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion packages/browser/src/sdk.ts
Expand Up @@ -7,7 +7,6 @@ export const defaultIntegrations = [
new CoreIntegrations.Dedupe(),
new CoreIntegrations.InboundFilters(),
new CoreIntegrations.FunctionToString(),
new CoreIntegrations.ExtraErrorData(),
new TryCatch(),
new Breadcrumbs(),
new GlobalHandlers(),
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/integrations/index.ts
@@ -1,4 +1,3 @@
export { Dedupe } from './dedupe';
export { FunctionToString } from './functiontostring';
export { InboundFilters } from './inboundfilters';
export { ExtraErrorData } from './extraerrordata';
10 changes: 5 additions & 5 deletions packages/integrations/package.json
@@ -1,6 +1,6 @@
{
"name": "@sentry/integrations",
"version": "4.6.3",
"version": "5.0.0-beta0",
"description": "Pluggable integrations that can be used to enchance JS SDKs",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/integrations",
Expand All @@ -13,10 +13,10 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "4.6.3",
"@sentry/hub": "4.6.3",
"@sentry/types": "4.5.3",
"@sentry/utils": "4.6.3",
"@sentry/core": "5.0.0-beta0",
"@sentry/hub": "5.0.0-beta0",
"@sentry/types": "5.0.0-beta0",
"@sentry/utils": "5.0.0-beta0",
"tslib": "^1.9.3"
},
"devDependencies": {
Expand Down
Expand Up @@ -4,6 +4,11 @@ import { isError, isPlainObject } from '@sentry/utils/is';
import { logger } from '@sentry/utils/logger';
import { normalize } from '@sentry/utils/object';

/** JSDoc */
interface ExtraErrorDataOptions {
depth?: number;
}

/** Patch toString calls to return proper name for wrapped functions */
export class ExtraErrorData implements Integration {
/**
Expand All @@ -16,6 +21,11 @@ export class ExtraErrorData implements Integration {
*/
public static id: string = 'ExtraErrorData';

/**
* @inheritDoc
*/
public constructor(private readonly options: ExtraErrorDataOptions = { depth: 3 }) {}

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -44,7 +54,7 @@ export class ExtraErrorData implements Integration {
...event.extra,
};

const normalizedErrorData = normalize(errorData);
const normalizedErrorData = normalize(errorData, this.options.depth);
if (isPlainObject(normalizedErrorData)) {
extra = {
...event.extra,
Expand Down
@@ -1,5 +1,5 @@
import { ExtendedError, SentryEvent } from '@sentry/types';
import { ExtraErrorData } from '../../../src/integrations/extraerrordata';
import { ExtraErrorData } from '../src/extraerrordata';

const extraErrorData = new ExtraErrorData();
let event: SentryEvent;
Expand Down
1 change: 0 additions & 1 deletion packages/node/src/sdk.ts
Expand Up @@ -10,7 +10,6 @@ export const defaultIntegrations = [
new CoreIntegrations.Dedupe(),
new CoreIntegrations.InboundFilters(),
new CoreIntegrations.FunctionToString(),
new CoreIntegrations.ExtraErrorData(),
// Native Wrappers
new Console(),
new Http(),
Expand Down
4 changes: 0 additions & 4 deletions yarn.lock
Expand Up @@ -6791,10 +6791,6 @@ lru_map@0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd"

lsmod@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/lsmod/-/lsmod-1.0.0.tgz#9a00f76dca36eb23fa05350afe1b585d4299e64b"

macos-release@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.0.0.tgz#7dddf4caf79001a851eb4fba7fb6034f251276ab"
Expand Down

0 comments on commit 4d11eb3

Please sign in to comment.