Skip to content

Commit 41e3200

Browse files
committed
[v7] Remove ASentryError usage and ignoreInternal options from InboundFilters
1 parent 70797ca commit 41e3200

File tree

7 files changed

+1
-53
lines changed

7 files changed

+1
-53
lines changed

packages/integration-common-inboundfilters/src/index.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ interface InboundFiltersOptions {
99
allowUrls: Array<string | RegExp>;
1010
denyUrls: Array<string | RegExp>;
1111
ignoreErrors: Array<string | RegExp>;
12-
ignoreInternal: boolean;
1312
}
1413

1514
/** Inbound filters configurable by the user */
@@ -35,13 +34,6 @@ export class InboundFilters implements Integration {
3534
}
3635

3736
private _shouldDropEvent(event: SentryEvent, options: Partial<InboundFiltersOptions>): boolean {
38-
if (this._isSentryError(event, options)) {
39-
this._client.logger.warn(
40-
`Event dropped due to being internal Sentry Error.\nEvent: ${getEventDescription(event)}`,
41-
);
42-
return true;
43-
}
44-
4537
if (this._isIgnoredError(event, options)) {
4638
this._client.logger.warn(
4739
`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(event)}`,
@@ -70,25 +62,6 @@ export class InboundFilters implements Integration {
7062
return false;
7163
}
7264

73-
private _isSentryError(event: SentryEvent, options: Partial<InboundFiltersOptions>): boolean {
74-
if (!options.ignoreInternal) {
75-
return false;
76-
}
77-
78-
try {
79-
return (
80-
(event &&
81-
event.exception &&
82-
event.exception.values &&
83-
event.exception.values[0] &&
84-
event.exception.values[0].type === 'SentryError') ||
85-
false
86-
);
87-
} catch (_oO) {
88-
return false;
89-
}
90-
}
91-
9265
private _isIgnoredError(event: SentryEvent, options: Partial<InboundFiltersOptions>): boolean {
9366
if (!options.ignoreErrors || !options.ignoreErrors.length) {
9467
return false;
@@ -125,7 +98,6 @@ export class InboundFilters implements Integration {
12598
...(clientOptions.ignoreErrors || []),
12699
...DEFAULT_IGNORE_ERRORS,
127100
],
128-
ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true,
129101
};
130102
}
131103

packages/transport-base/src/asyncBuffer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export class AsyncBuffer<T> {
1414

1515
public add(task: Task<T>): PromiseLike<T> {
1616
if (this.length >= this._limit) {
17-
// TODO: Use SentryError
1817
return Promise.reject(new Error('Not adding task due to buffer limit reached.'));
1918
}
2019

packages/transport-base/src/dsn.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export class Dsn {
7272
const dsnMatch = DSN_REGEX.exec(url);
7373

7474
if (!dsnMatch) {
75-
// TODO: Use SentryError
7675
throw new Error(INVALID_DSN);
7776
}
7877

@@ -97,12 +96,10 @@ export class Dsn {
9796
}
9897

9998
if (protocol !== 'http' && protocol !== 'https') {
100-
// TODO: Use SentryError
10199
throw new Error(`${INVALID_DSN} protocol: ${protocol}`);
102100
}
103101

104102
if (!projectId.match(/^\d+$/)) {
105-
// TODO: Use SentryError
106103
throw new Error(`${INVALID_DSN} projectId: ${projectId}`);
107104
}
108105

packages/transport-base/src/transport.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export abstract class BaseTransport {
1212

1313
public constructor(public options: TransportOptions) {
1414
this._dsn = new Dsn(this.options.dsn);
15-
// this._dsn = typeof this.options.dsn === 'string' ? new Dsn(this.options.dsn) : this.options.dsn;
1615
this._asyncBuffer = new AsyncBuffer(this.options.bufferSize ?? 30);
1716
}
1817

@@ -21,7 +20,6 @@ export abstract class BaseTransport {
2120
requestMaker: TransportRequestMaker<T>,
2221
): PromiseLike<TransportResponse> {
2322
if (isRateLimited(this._rateLimits, request.type)) {
24-
// TODO: Use SentryError
2523
return Promise.reject(
2624
new Error(
2725
`Transport for \`${request.type}\` locked till ${disabledUntil(
@@ -50,7 +48,6 @@ export abstract class BaseTransport {
5048
return Promise.resolve({ status });
5149
}
5250

53-
// TODO: Use SentryError
5451
return Promise.reject(new Error(body ?? reason ?? 'Unknown transport error'));
5552
},
5653
);

packages/utils/src/error.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/utils/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from './browser';
2-
export * from './error';
32
export * from './instrument';
43
export * from './is';
54
export * from './logger';

packages/utils/src/promisebuffer.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { SentryError } from './error';
2-
31
/** A simple queue that holds promises. */
42
export class PromiseBuffer<T> {
53
/** Internal set of queued Promises */
@@ -22,7 +20,7 @@ export class PromiseBuffer<T> {
2220
*/
2321
public add(task: PromiseLike<T>): PromiseLike<T> {
2422
if (!this.isReady()) {
25-
return Promise.reject(new SentryError('Not adding Promise due to buffer limit reached.'));
23+
return Promise.reject(new Error('Not adding Promise due to buffer limit reached.'));
2624
}
2725
if (this._buffer.indexOf(task) === -1) {
2826
this._buffer.push(task);

0 commit comments

Comments
 (0)