Skip to content

Commit 26fcb59

Browse files
committed
3.24.2
1 parent d92b6a2 commit 26fcb59

22 files changed

+102
-55
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 3.24.2
4+
5+
* FEAT: Capture breadcrumbs on failed fetch request (#1293)
6+
* BUGFIX: Make debug mode actually work (#1305)
7+
* BUGFIX: Use correct frame url in ignore/whitelisturl calls (#1304)
8+
* BUGFIX: Check input type before doing truncation (#1299)
9+
310
## 3.24.1
411

512
* FEAT: Add flag for unhandled promise rejections (#1278)

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raven-js",
3-
"version": "3.24.1",
3+
"version": "3.24.2",
44
"dependencies": {},
55
"main": "dist/raven.js",
66
"ignore": [

dist/plugins/angular.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.24.1 (f3b3500) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.24.2 (d92b6a2) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -250,7 +250,13 @@ function objectFrozen(obj) {
250250
}
251251

252252
function truncate(str, max) {
253-
return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
253+
if (typeof max !== 'number') {
254+
throw new Error('2nd argument to `truncate` function should be a number');
255+
}
256+
if (typeof str !== 'string' || max === 0) {
257+
return str;
258+
}
259+
return str.length <= max ? str : str.substr(0, max) + '\u2026';
254260
}
255261

256262
/**
@@ -549,10 +555,9 @@ function jsonSize(value) {
549555
}
550556

551557
function serializeValue(value) {
552-
var maxLength = 40;
553-
554558
if (typeof value === 'string') {
555-
return value.length <= maxLength ? value : value.substr(0, maxLength - 1) + '\u2026';
559+
var maxLength = 40;
560+
return truncate(value, maxLength);
556561
} else if (
557562
typeof value === 'number' ||
558563
typeof value === 'boolean' ||

dist/plugins/angular.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/angular.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/console.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.24.1 (f3b3500) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.24.2 (d92b6a2) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -252,7 +252,13 @@ function objectFrozen(obj) {
252252
}
253253

254254
function truncate(str, max) {
255-
return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
255+
if (typeof max !== 'number') {
256+
throw new Error('2nd argument to `truncate` function should be a number');
257+
}
258+
if (typeof str !== 'string' || max === 0) {
259+
return str;
260+
}
261+
return str.length <= max ? str : str.substr(0, max) + '\u2026';
256262
}
257263

258264
/**
@@ -551,10 +557,9 @@ function jsonSize(value) {
551557
}
552558

553559
function serializeValue(value) {
554-
var maxLength = 40;
555-
556560
if (typeof value === 'string') {
557-
return value.length <= maxLength ? value : value.substr(0, maxLength - 1) + '\u2026';
561+
var maxLength = 40;
562+
return truncate(value, maxLength);
558563
} else if (
559564
typeof value === 'number' ||
560565
typeof value === 'boolean' ||

dist/plugins/console.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/console.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/ember.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.24.1 (f3b3500) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.24.2 (d92b6a2) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

dist/plugins/ember.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/require.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.24.1 (f3b3500) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.24.2 (d92b6a2) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

dist/plugins/require.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/vue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.24.1 (f3b3500) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.24.2 (d92b6a2) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

dist/plugins/vue.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/raven.js

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.24.1 (f3b3500) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.24.2 (d92b6a2) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -205,7 +205,7 @@ Raven.prototype = {
205205
// webpack (using a build step causes webpack #1617). Grunt verifies that
206206
// this value matches package.json during build.
207207
// See: https://github.com/getsentry/raven-js/issues/465
208-
VERSION: '3.24.1',
208+
VERSION: '3.24.2',
209209

210210
debug: false,
211211

@@ -639,6 +639,14 @@ Raven.prototype = {
639639

640640
// stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
641641
var initialCall = isArray(stack.stack) && stack.stack[1];
642+
643+
// if stack[1] is `Raven.captureException`, it means that someone passed a string to it and we redirected that call
644+
// to be handled by `captureMessage`, thus `initialCall` is the 3rd one, not 2nd
645+
// initialCall => captureException(string) => captureMessage(string)
646+
if (initialCall && initialCall.func === 'Raven.captureException') {
647+
initialCall = stack.stack[2];
648+
}
649+
642650
var fileurl = (initialCall && initialCall.url) || '';
643651

644652
if (
@@ -1436,17 +1444,30 @@ Raven.prototype = {
14361444
status_code: null
14371445
};
14381446

1439-
return origFetch.apply(this, args).then(function(response) {
1440-
fetchData.status_code = response.status;
1447+
return origFetch
1448+
.apply(this, args)
1449+
.then(function(response) {
1450+
fetchData.status_code = response.status;
14411451

1442-
self.captureBreadcrumb({
1443-
type: 'http',
1444-
category: 'fetch',
1445-
data: fetchData
1446-
});
1452+
self.captureBreadcrumb({
1453+
type: 'http',
1454+
category: 'fetch',
1455+
data: fetchData
1456+
});
14471457

1448-
return response;
1449-
});
1458+
return response;
1459+
})
1460+
['catch'](function(err) {
1461+
// if there is an error performing the request
1462+
self.captureBreadcrumb({
1463+
type: 'http',
1464+
category: 'fetch',
1465+
data: fetchData,
1466+
level: 'error'
1467+
});
1468+
1469+
throw err;
1470+
});
14501471
};
14511472
},
14521473
wrappedBuiltIns
@@ -1459,7 +1480,7 @@ Raven.prototype = {
14591480
if (_document.addEventListener) {
14601481
_document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
14611482
_document.addEventListener('keypress', self._keypressEventHandler(), false);
1462-
} else if(_document.attachEvent){
1483+
} else if (_document.attachEvent) {
14631484
// IE8 Compatibility
14641485
_document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
14651486
_document.attachEvent('onkeypress', self._keypressEventHandler());
@@ -2182,7 +2203,11 @@ Raven.prototype = {
21822203
},
21832204

21842205
_logDebug: function(level) {
2185-
if (this._originalConsoleMethods[level] && this.debug) {
2206+
// We allow `Raven.debug` and `Raven.config(DSN, { debug: true })` to not make backward incompatible API change
2207+
if (
2208+
this._originalConsoleMethods[level] &&
2209+
(this.debug || this._globalOptions.debug)
2210+
) {
21862211
// In IE<10 console methods do not have their own 'apply' method
21872212
Function.prototype.apply.call(
21882213
this._originalConsoleMethods[level],
@@ -2443,7 +2468,13 @@ function objectFrozen(obj) {
24432468
}
24442469

24452470
function truncate(str, max) {
2446-
return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
2471+
if (typeof max !== 'number') {
2472+
throw new Error('2nd argument to `truncate` function should be a number');
2473+
}
2474+
if (typeof str !== 'string' || max === 0) {
2475+
return str;
2476+
}
2477+
return str.length <= max ? str : str.substr(0, max) + '\u2026';
24472478
}
24482479

24492480
/**
@@ -2742,10 +2773,9 @@ function jsonSize(value) {
27422773
}
27432774

27442775
function serializeValue(value) {
2745-
var maxLength = 40;
2746-
27472776
if (typeof value === 'string') {
2748-
return value.length <= maxLength ? value : value.substr(0, maxLength - 1) + '\u2026';
2777+
var maxLength = 40;
2778+
return truncate(value, maxLength);
27492779
} else if (
27502780
typeof value === 'number' ||
27512781
typeof value === 'boolean' ||

dist/raven.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/raven.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sri.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"@dist/raven.js": {
33
"hashes": {
4-
"sha256": "/ONdAalAceMcNzn9xPsmeCnrYM52+JxI9taRSMwL6Bk=",
5-
"sha512": "WMqEoQ1FfK46hKApMRtpKlvPKecuWGMCj7DRPglDKip7HXRv4xt1DiKSBPn0msNN1K4uI67lesz5wdIw5lE1AQ=="
4+
"sha256": "986P+XPpcUAsCgHIffZrLXOM3qF8hwwRAf8Pbj3+l0U=",
5+
"sha512": "B1SSEgalruqKHRjLG3hl+g55bgm5ucuCRg8oBCyB0DcIXhNlsHxeG3XwmDn93lAy9yLIMAW3hXKehkZj+h+8HQ=="
66
},
77
"type": null,
8-
"integrity": "sha256-/ONdAalAceMcNzn9xPsmeCnrYM52+JxI9taRSMwL6Bk= sha512-WMqEoQ1FfK46hKApMRtpKlvPKecuWGMCj7DRPglDKip7HXRv4xt1DiKSBPn0msNN1K4uI67lesz5wdIw5lE1AQ==",
8+
"integrity": "sha256-986P+XPpcUAsCgHIffZrLXOM3qF8hwwRAf8Pbj3+l0U= sha512-B1SSEgalruqKHRjLG3hl+g55bgm5ucuCRg8oBCyB0DcIXhNlsHxeG3XwmDn93lAy9yLIMAW3hXKehkZj+h+8HQ==",
99
"path": "dist/raven.js"
1010
},
1111
"@dist/raven.min.js": {
1212
"hashes": {
13-
"sha256": "C0v6xCW0XKv2zJSWSiNl920zYMsEWWLUvysjc48qp88=",
14-
"sha512": "tdc7P+N+tY7wHWTALVNM1bTI0cdpgFckHXhydV0dWE4q1S3w9EWOJJYKF2Jy9J4srTruk3p/QJtH+/PpsCUsjw=="
13+
"sha256": "iSi2Hd/fgRrUbyfELh7lQ0S4iqkOSNmEBMeb+rED1gI=",
14+
"sha512": "VLhKf10cRS55TuheDYJRq3t5EU86sjfnu3ZEbIjGgo6AlZXJIZfvTSbOYTFliA9QABBfl057rAEyptvDPYuOMA=="
1515
},
1616
"type": null,
17-
"integrity": "sha256-C0v6xCW0XKv2zJSWSiNl920zYMsEWWLUvysjc48qp88= sha512-tdc7P+N+tY7wHWTALVNM1bTI0cdpgFckHXhydV0dWE4q1S3w9EWOJJYKF2Jy9J4srTruk3p/QJtH+/PpsCUsjw==",
17+
"integrity": "sha256-iSi2Hd/fgRrUbyfELh7lQ0S4iqkOSNmEBMeb+rED1gI= sha512-VLhKf10cRS55TuheDYJRq3t5EU86sjfnu3ZEbIjGgo6AlZXJIZfvTSbOYTFliA9QABBfl057rAEyptvDPYuOMA==",
1818
"path": "dist/raven.min.js"
1919
}
2020
}

docs/sentry-doc-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@
6666
}
6767
},
6868
"vars": {
69-
"RAVEN_VERSION": "3.24.1"
69+
"RAVEN_VERSION": "3.24.2"
7070
}
7171
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"raven",
1010
"sentry"
1111
],
12-
"version": "3.24.1",
12+
"version": "3.24.2",
1313
"repository": "git://github.com/getsentry/raven-js.git",
1414
"license": "BSD-2-Clause",
1515
"homepage": "https://github.com/getsentry/raven-js",

src/raven.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Raven.prototype = {
137137
// webpack (using a build step causes webpack #1617). Grunt verifies that
138138
// this value matches package.json during build.
139139
// See: https://github.com/getsentry/raven-js/issues/465
140-
VERSION: '3.24.1',
140+
VERSION: '3.24.2',
141141

142142
debug: false,
143143

test/raven.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ describe('globals', function() {
13681368
extra: {'session:duration': 100}
13691369
});
13701370
assert.deepEqual(opts.auth, {
1371-
sentry_client: 'raven-js/3.24.1',
1371+
sentry_client: 'raven-js/3.24.2',
13721372
sentry_key: 'abc',
13731373
sentry_version: '7'
13741374
});
@@ -1415,7 +1415,7 @@ describe('globals', function() {
14151415
extra: {'session:duration': 100}
14161416
});
14171417
assert.deepEqual(opts.auth, {
1418-
sentry_client: 'raven-js/3.24.1',
1418+
sentry_client: 'raven-js/3.24.2',
14191419
sentry_key: 'abc',
14201420
sentry_secret: 'def',
14211421
sentry_version: '7'

0 commit comments

Comments
 (0)