Skip to content

Commit 12b2ebc

Browse files
committed
Revert "Apply suggestions from code review"
This reverts commit e60fe99.
1 parent 3fd6324 commit 12b2ebc

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

packages/browser/src/client.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DsnLike, Event, EventHint } from '@sentry/types';
33
import { getGlobalObject, logger } from '@sentry/utils';
44

55
import { BrowserBackend, BrowserOptions } from './backend';
6-
import { Breadcrumbs } from './integrations';
6+
import { Breadcrumbs } from './integrations/index';
77
import { SDK_NAME, SDK_VERSION } from './version';
88

99
/**
@@ -79,20 +79,22 @@ export class BrowserClient extends BaseClient<BrowserBackend, BrowserOptions> {
7979

8080
this._processEvent(event, hint, scope)
8181
.then(finalEvent => {
82-
// We need to check for finalEvent in case beforeSend returned null.
83-
if (!finalEvent) {
84-
return;
85-
}
86-
eventId = finalEvent.event_id;
82+
// We need to check for finalEvent in case beforeSend returned null
83+
eventId = finalEvent && finalEvent.event_id;
8784
// We do this here to not parse any requests if they are outgoing to Sentry
8885
// We log breadcrumbs if the integration has them enabled
89-
const integration = this.getIntegration(Breadcrumbs);
90-
if (integration) {
91-
integration.addSentryBreadcrumb(finalEvent);
86+
if (finalEvent) {
87+
const integration = this.getIntegration(Breadcrumbs);
88+
if (integration) {
89+
integration.addSentryBreadcrumb(finalEvent);
90+
}
9291
}
92+
this._processing = false;
9393
})
94-
.catch(reason => logger.error(reason))
95-
.finally(() => (this._processing = false));
94+
.then(null, reason => {
95+
logger.error(reason);
96+
this._processing = false;
97+
});
9698

9799
return eventId;
98100
}

0 commit comments

Comments
 (0)