Skip to content

Commit 0c53b6b

Browse files
committed
less changes
1 parent 124fd8f commit 0c53b6b

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

packages/core/src/client.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -875,18 +875,15 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
875875
public sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {
876876
this.emit('beforeEnvelope', envelope);
877877

878-
if (!this._isEnabled() || !this._transport) {
879-
DEBUG_BUILD && debug.error('Transport disabled');
880-
return resolvedSyncPromise({});
881-
}
882-
883-
return this._transport.send(envelope).then(
884-
response => response,
885-
reason => {
878+
if (this._isEnabled() && this._transport) {
879+
return this._transport.send(envelope).then(null, reason => {
886880
DEBUG_BUILD && debug.error('Error while sending envelope:', reason);
887881
return {};
888-
},
889-
);
882+
});
883+
}
884+
885+
DEBUG_BUILD && debug.error('Transport disabled');
886+
return resolvedSyncPromise({});
890887
}
891888

892889
/* eslint-enable @typescript-eslint/unified-signatures */

0 commit comments

Comments
 (0)