Skip to content

Commit fffb7d9

Browse files
committed
Fix comments
1 parent 0c6a622 commit fffb7d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/raven.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,31 +1327,34 @@ Raven.prototype = {
13271327
},
13281328

13291329
_setBackoffState: function(request) {
1330-
// if we are already in a backoff state, don't change anything
1330+
// If we are already in a backoff state, don't change anything
13311331
if (this._shouldBackoff()) {
13321332
return;
13331333
}
13341334

13351335
var status = request.status;
13361336

13371337
// 400 - project_id doesn't exist or some other fatal
1338-
// 401 - nvalid/revoked dsn
1338+
// 401 - invalid/revoked dsn
13391339
// 429 - too many requests
13401340
if (!(status === 400 || status === 401 || status === 429))
13411341
return;
13421342

13431343
var retry;
13441344
try {
1345-
// If Retry-After is not in Access-Control-Allow-Headers, most
1345+
// If Retry-After is not in Access-Control-Expose-Headers, most
13461346
// browsers will throw an exception trying to access it
13471347
retry = request.getResponseHeader('Retry-After');
13481348
retry = parseInt(retry, 10);
13491349
} catch (e) {
13501350
/* eslint no-empty:0 */
13511351
}
13521352

1353+
13531354
this._backoffDuration = retry
1355+
// If Sentry server returned a Retry-After value, use it
13541356
? retry
1357+
// Otherwise, double the last backoff duration (starts at 1 sec)
13551358
: this._backoffDuration * 2 || 1000;
13561359

13571360
this._backoffStart = now();

0 commit comments

Comments
 (0)