Skip to content

Commit e0e653a

Browse files
lforstAbhiPrasad
authored andcommitted
ref(core): Log warning on NOK transport response (#5091)
1 parent 2039de2 commit e0e653a

File tree

1 file changed

+5
-0
lines changed
  • packages/core/src/transports

1 file changed

+5
-0
lines changed

packages/core/src/transports/base.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ export function createTransport(
7171
const requestTask = (): PromiseLike<void> =>
7272
makeRequest({ body: serializeEnvelope(filteredEnvelope) }).then(
7373
response => {
74+
// We don't want to throw on NOK responses, but we want to at least log them
75+
if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {
76+
IS_DEBUG_BUILD && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);
77+
}
78+
7479
rateLimits = updateRateLimits(rateLimits, response);
7580
},
7681
error => {

0 commit comments

Comments
 (0)