File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1328,8 +1328,9 @@ Raven.prototype = {
1328
1328
1329
1329
_setBackoffState : function ( request ) {
1330
1330
// if we are already in a backoff state, don't change anything
1331
- if ( this . _shouldBackoff ( ) )
1331
+ if ( this . _shouldBackoff ( ) ) {
1332
1332
return ;
1333
+ }
1333
1334
1334
1335
var status = request . status ;
1335
1336
@@ -1357,10 +1358,6 @@ Raven.prototype = {
1357
1358
} ,
1358
1359
1359
1360
_send : function ( data ) {
1360
- if ( this . _shouldBackoff ( ) ) {
1361
- return ;
1362
- }
1363
-
1364
1361
var globalOptions = this . _globalOptions ;
1365
1362
1366
1363
var baseData = {
@@ -1424,6 +1421,13 @@ Raven.prototype = {
1424
1421
return ;
1425
1422
}
1426
1423
1424
+ // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
1425
+ // so drop requests until "cool-off" period has elapsed.
1426
+ if ( this . _shouldBackoff ( ) ) {
1427
+ this . _logDebug ( 'warn' , 'Raven dropped error due to backoff: ' , data ) ;
1428
+ return ;
1429
+ }
1430
+
1427
1431
this . _sendProcessedPayload ( data ) ;
1428
1432
} ,
1429
1433
@@ -1483,6 +1487,8 @@ Raven.prototype = {
1483
1487
callback && callback ( ) ;
1484
1488
} ,
1485
1489
onError : function failure ( error ) {
1490
+ self . _logDebug ( 'error' , 'Raven transport failed to send: ' , error ) ;
1491
+
1486
1492
if ( error . request ) {
1487
1493
self . _setBackoffState ( error . request ) ;
1488
1494
}
You can’t perform that action at this time.
0 commit comments