@sentry/browser 6.17.0-beta.0 → 6.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bundle.es6.js +122 -119
- package/build/bundle.es6.js.map +1 -1
- package/build/bundle.es6.min.js +2 -2
- package/build/bundle.es6.min.js.map +1 -1
- package/build/bundle.js +123 -105
- package/build/bundle.js.map +1 -1
- package/build/bundle.min.js +2 -2
- package/build/bundle.min.js.map +1 -1
- package/dist/backend.d.ts +2 -2
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +2 -1
- package/dist/backend.js.map +1 -1
- package/dist/eventbuilder.d.ts +4 -4
- package/dist/eventbuilder.d.ts.map +1 -1
- package/dist/eventbuilder.js +8 -7
- package/dist/eventbuilder.js.map +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/exports.d.ts.map +1 -1
- package/dist/exports.js +2 -0
- package/dist/exports.js.map +1 -1
- package/dist/helpers.js.map +1 -1
- package/dist/integrations/breadcrumbs.d.ts.map +1 -1
- package/dist/integrations/breadcrumbs.js +2 -1
- package/dist/integrations/breadcrumbs.js.map +1 -1
- package/dist/integrations/globalhandlers.d.ts.map +1 -1
- package/dist/integrations/globalhandlers.js +4 -3
- package/dist/integrations/globalhandlers.js.map +1 -1
- package/dist/integrations/trycatch.js.map +1 -1
- package/dist/tracekit.d.ts.map +1 -1
- package/dist/tracekit.js.map +1 -1
- package/dist/transports/fetch.js +3 -3
- package/dist/transports/fetch.js.map +1 -1
- package/esm/backend.d.ts +2 -2
- package/esm/backend.d.ts.map +1 -1
- package/esm/backend.js +2 -1
- package/esm/backend.js.map +1 -1
- package/esm/eventbuilder.d.ts +4 -4
- package/esm/eventbuilder.d.ts.map +1 -1
- package/esm/eventbuilder.js +8 -7
- package/esm/eventbuilder.js.map +1 -1
- package/esm/exports.d.ts +1 -1
- package/esm/exports.d.ts.map +1 -1
- package/esm/exports.js +1 -0
- package/esm/exports.js.map +1 -1
- package/esm/helpers.js.map +1 -1
- package/esm/integrations/breadcrumbs.d.ts.map +1 -1
- package/esm/integrations/breadcrumbs.js +2 -1
- package/esm/integrations/breadcrumbs.js.map +1 -1
- package/esm/integrations/globalhandlers.d.ts.map +1 -1
- package/esm/integrations/globalhandlers.js +4 -3
- package/esm/integrations/globalhandlers.js.map +1 -1
- package/esm/integrations/trycatch.js.map +1 -1
- package/esm/tracekit.d.ts.map +1 -1
- package/esm/tracekit.js.map +1 -1
- package/esm/transports/fetch.js +3 -3
- package/esm/transports/fetch.js.map +1 -1
- package/package.json +4 -4
package/build/bundle.es6.js
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
/*! @sentry/browser 6.17.
|
|
1
|
+
/*! @sentry/browser 6.17.3 (42e245a) | https://github.com/getsentry/sentry-javascript */
|
|
2
2
|
var Sentry = (function (exports) {
|
|
3
|
+
/**
|
|
4
|
+
* TODO(v7): Remove this enum and replace with SeverityLevel
|
|
5
|
+
*/
|
|
6
|
+
(function (Severity) {
|
|
7
|
+
/** JSDoc */
|
|
8
|
+
Severity["Fatal"] = "fatal";
|
|
9
|
+
/** JSDoc */
|
|
10
|
+
Severity["Error"] = "error";
|
|
11
|
+
/** JSDoc */
|
|
12
|
+
Severity["Warning"] = "warning";
|
|
13
|
+
/** JSDoc */
|
|
14
|
+
Severity["Log"] = "log";
|
|
15
|
+
/** JSDoc */
|
|
16
|
+
Severity["Info"] = "info";
|
|
17
|
+
/** JSDoc */
|
|
18
|
+
Severity["Debug"] = "debug";
|
|
19
|
+
/** JSDoc */
|
|
20
|
+
Severity["Critical"] = "critical";
|
|
21
|
+
})(exports.Severity || (exports.Severity = {}));
|
|
22
|
+
const SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical'];
|
|
23
|
+
|
|
3
24
|
/**
|
|
4
25
|
* Consumes the promise and logs the error when it rejects.
|
|
5
26
|
* @param promise A promise to forget.
|
|
@@ -151,7 +172,7 @@ var Sentry = (function (exports) {
|
|
|
151
172
|
return isBuiltin(wat, 'String');
|
|
152
173
|
}
|
|
153
174
|
/**
|
|
154
|
-
* Checks whether given value
|
|
175
|
+
* Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
|
|
155
176
|
* {@link isPrimitive}.
|
|
156
177
|
*
|
|
157
178
|
* @param wat A value to be checked.
|
|
@@ -394,7 +415,7 @@ var Sentry = (function (exports) {
|
|
|
394
415
|
function dsnFromString(str) {
|
|
395
416
|
const match = DSN_REGEX.exec(str);
|
|
396
417
|
if (!match) {
|
|
397
|
-
throw new SentryError(
|
|
418
|
+
throw new SentryError(`Invalid Sentry Dsn: ${str}`);
|
|
398
419
|
}
|
|
399
420
|
const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);
|
|
400
421
|
let path = '';
|
|
@@ -436,17 +457,17 @@ var Sentry = (function (exports) {
|
|
|
436
457
|
const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];
|
|
437
458
|
requiredComponents.forEach(component => {
|
|
438
459
|
if (!dsn[component]) {
|
|
439
|
-
throw new SentryError(`Invalid Dsn: ${component} missing`);
|
|
460
|
+
throw new SentryError(`Invalid Sentry Dsn: ${component} missing`);
|
|
440
461
|
}
|
|
441
462
|
});
|
|
442
463
|
if (!projectId.match(/^\d+$/)) {
|
|
443
|
-
throw new SentryError(`Invalid Dsn: Invalid projectId ${projectId}`);
|
|
464
|
+
throw new SentryError(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
|
|
444
465
|
}
|
|
445
466
|
if (!isValidProtocol(protocol)) {
|
|
446
|
-
throw new SentryError(`Invalid Dsn: Invalid protocol ${protocol}`);
|
|
467
|
+
throw new SentryError(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
|
|
447
468
|
}
|
|
448
469
|
if (port && isNaN(parseInt(port, 10))) {
|
|
449
|
-
throw new SentryError(`Invalid Dsn: Invalid port ${port}`);
|
|
470
|
+
throw new SentryError(`Invalid Sentry Dsn: Invalid port ${port}`);
|
|
450
471
|
}
|
|
451
472
|
return true;
|
|
452
473
|
}
|
|
@@ -892,7 +913,7 @@ var Sentry = (function (exports) {
|
|
|
892
913
|
*/
|
|
893
914
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
894
915
|
function walk(key, value, depth = +Infinity, memo = memoBuilder()) {
|
|
895
|
-
// If we reach the maximum depth, serialize whatever
|
|
916
|
+
// If we reach the maximum depth, serialize whatever is left
|
|
896
917
|
if (depth === 0) {
|
|
897
918
|
return serializeValue(value);
|
|
898
919
|
}
|
|
@@ -902,12 +923,13 @@ var Sentry = (function (exports) {
|
|
|
902
923
|
return value.toJSON();
|
|
903
924
|
}
|
|
904
925
|
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
|
905
|
-
// If normalized value is a primitive, there are no branches left to walk, so
|
|
926
|
+
// If normalized value is a primitive, there are no branches left to walk, so bail out
|
|
906
927
|
const normalized = normalizeValue(value, key);
|
|
907
928
|
if (isPrimitive(normalized)) {
|
|
908
929
|
return normalized;
|
|
909
930
|
}
|
|
910
|
-
// Create source that we will use for next
|
|
931
|
+
// Create source that we will use for the next iteration. It will either be an objectified error object (`Error` type
|
|
932
|
+
// with extracted key:value pairs) or the input itself.
|
|
911
933
|
const source = getWalkSource(value);
|
|
912
934
|
// Create an accumulator that will act as a parent for all future itterations of that branch
|
|
913
935
|
const acc = Array.isArray(value) ? [] : {};
|
|
@@ -1072,9 +1094,9 @@ var Sentry = (function (exports) {
|
|
|
1072
1094
|
* @returns Answer to the given question.
|
|
1073
1095
|
*/
|
|
1074
1096
|
function supportsReferrerPolicy() {
|
|
1075
|
-
// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
|
|
1076
|
-
// https://caniuse.com/#feat=referrer-policy
|
|
1077
|
-
//
|
|
1097
|
+
// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
|
|
1098
|
+
// (see https://caniuse.com/#feat=referrer-policy),
|
|
1099
|
+
// it doesn't. And it throws an exception instead of ignoring this parameter...
|
|
1078
1100
|
// REF: https://github.com/getsentry/raven-js/issues/1233
|
|
1079
1101
|
if (!supportsFetch()) {
|
|
1080
1102
|
return false;
|
|
@@ -1257,9 +1279,6 @@ var Sentry = (function (exports) {
|
|
|
1257
1279
|
if (!('XMLHttpRequest' in global$2)) {
|
|
1258
1280
|
return;
|
|
1259
1281
|
}
|
|
1260
|
-
// Poor man's implementation of ES6 `Map`, tracking and keeping in sync key and value separately.
|
|
1261
|
-
const requestKeys = [];
|
|
1262
|
-
const requestValues = [];
|
|
1263
1282
|
const xhrproto = XMLHttpRequest.prototype;
|
|
1264
1283
|
fill(xhrproto, 'open', function (originalOpen) {
|
|
1265
1284
|
return function (...args) {
|
|
@@ -1286,20 +1305,6 @@ var Sentry = (function (exports) {
|
|
|
1286
1305
|
catch (e) {
|
|
1287
1306
|
/* do nothing */
|
|
1288
1307
|
}
|
|
1289
|
-
try {
|
|
1290
|
-
const requestPos = requestKeys.indexOf(xhr);
|
|
1291
|
-
if (requestPos !== -1) {
|
|
1292
|
-
// Make sure to pop both key and value to keep it in sync.
|
|
1293
|
-
requestKeys.splice(requestPos);
|
|
1294
|
-
const args = requestValues.splice(requestPos)[0];
|
|
1295
|
-
if (args[0] !== undefined) {
|
|
1296
|
-
xhrInfo.body = args[0];
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
catch (e) {
|
|
1301
|
-
/* do nothing */
|
|
1302
|
-
}
|
|
1303
1308
|
triggerHandlers('xhr', {
|
|
1304
1309
|
args,
|
|
1305
1310
|
endTimestamp: Date.now(),
|
|
@@ -1324,8 +1329,9 @@ var Sentry = (function (exports) {
|
|
|
1324
1329
|
});
|
|
1325
1330
|
fill(xhrproto, 'send', function (originalSend) {
|
|
1326
1331
|
return function (...args) {
|
|
1327
|
-
|
|
1328
|
-
|
|
1332
|
+
if (this.__sentry_xhr__ && args[0] !== undefined) {
|
|
1333
|
+
this.__sentry_xhr__.body = args[0];
|
|
1334
|
+
}
|
|
1329
1335
|
triggerHandlers('xhr', {
|
|
1330
1336
|
args,
|
|
1331
1337
|
startTimestamp: Date.now(),
|
|
@@ -2012,28 +2018,6 @@ var Sentry = (function (exports) {
|
|
|
2012
2018
|
};
|
|
2013
2019
|
}
|
|
2014
2020
|
|
|
2015
|
-
/** JSDoc
|
|
2016
|
-
* @deprecated Use string literals - if you require type casting, cast to SeverityLevel type
|
|
2017
|
-
*/
|
|
2018
|
-
var Severity;
|
|
2019
|
-
(function (Severity) {
|
|
2020
|
-
/** JSDoc */
|
|
2021
|
-
Severity["Fatal"] = "fatal";
|
|
2022
|
-
/** JSDoc */
|
|
2023
|
-
Severity["Error"] = "error";
|
|
2024
|
-
/** JSDoc */
|
|
2025
|
-
Severity["Warning"] = "warning";
|
|
2026
|
-
/** JSDoc */
|
|
2027
|
-
Severity["Log"] = "log";
|
|
2028
|
-
/** JSDoc */
|
|
2029
|
-
Severity["Info"] = "info";
|
|
2030
|
-
/** JSDoc */
|
|
2031
|
-
Severity["Debug"] = "debug";
|
|
2032
|
-
/** JSDoc */
|
|
2033
|
-
Severity["Critical"] = "critical";
|
|
2034
|
-
})(Severity || (Severity = {}));
|
|
2035
|
-
const SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical'];
|
|
2036
|
-
|
|
2037
2021
|
function isSupportedSeverity(level) {
|
|
2038
2022
|
return SeverityLevels.indexOf(level) !== -1;
|
|
2039
2023
|
}
|
|
@@ -2045,11 +2029,11 @@ var Sentry = (function (exports) {
|
|
|
2045
2029
|
*/
|
|
2046
2030
|
function severityFromString(level) {
|
|
2047
2031
|
if (level === 'warn')
|
|
2048
|
-
return
|
|
2032
|
+
return exports.Severity.Warning;
|
|
2049
2033
|
if (isSupportedSeverity(level)) {
|
|
2050
2034
|
return level;
|
|
2051
2035
|
}
|
|
2052
|
-
return
|
|
2036
|
+
return exports.Severity.Log;
|
|
2053
2037
|
}
|
|
2054
2038
|
|
|
2055
2039
|
/**
|
|
@@ -2230,6 +2214,11 @@ var Sentry = (function (exports) {
|
|
|
2230
2214
|
this._extra = {};
|
|
2231
2215
|
/** Contexts */
|
|
2232
2216
|
this._contexts = {};
|
|
2217
|
+
/**
|
|
2218
|
+
* A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
|
|
2219
|
+
* sent to Sentry
|
|
2220
|
+
*/
|
|
2221
|
+
this._sdkProcessingMetadata = {};
|
|
2233
2222
|
}
|
|
2234
2223
|
/**
|
|
2235
2224
|
* Inherit values from the parent scope.
|
|
@@ -2392,18 +2381,10 @@ var Sentry = (function (exports) {
|
|
|
2392
2381
|
* @inheritDoc
|
|
2393
2382
|
*/
|
|
2394
2383
|
getTransaction() {
|
|
2395
|
-
//
|
|
2384
|
+
// Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will
|
|
2385
|
+
// have a pointer to the currently-active transaction.
|
|
2396
2386
|
const span = this.getSpan();
|
|
2397
|
-
|
|
2398
|
-
if (span && span.transaction) {
|
|
2399
|
-
return span.transaction;
|
|
2400
|
-
}
|
|
2401
|
-
// fallback to the old way (known bug: this only finds transactions with sampled = true)
|
|
2402
|
-
if (span && span.spanRecorder && span.spanRecorder.spans[0]) {
|
|
2403
|
-
return span.spanRecorder.spans[0];
|
|
2404
|
-
}
|
|
2405
|
-
// neither way found a transaction
|
|
2406
|
-
return undefined;
|
|
2387
|
+
return span && span.transaction;
|
|
2407
2388
|
}
|
|
2408
2389
|
/**
|
|
2409
2390
|
* @inheritDoc
|
|
@@ -2553,8 +2534,16 @@ var Sentry = (function (exports) {
|
|
|
2553
2534
|
this._applyFingerprint(event);
|
|
2554
2535
|
event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];
|
|
2555
2536
|
event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;
|
|
2537
|
+
event.sdkProcessingMetadata = this._sdkProcessingMetadata;
|
|
2556
2538
|
return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);
|
|
2557
2539
|
}
|
|
2540
|
+
/**
|
|
2541
|
+
* Add data which will be accessible during event processing but won't get sent to Sentry
|
|
2542
|
+
*/
|
|
2543
|
+
setSDKProcessingMetadata(newData) {
|
|
2544
|
+
this._sdkProcessingMetadata = Object.assign(Object.assign({}, this._sdkProcessingMetadata), newData);
|
|
2545
|
+
return this;
|
|
2546
|
+
}
|
|
2558
2547
|
/**
|
|
2559
2548
|
* This will be called after {@link applyToEvent} is finished.
|
|
2560
2549
|
*/
|
|
@@ -3275,7 +3264,7 @@ var Sentry = (function (exports) {
|
|
|
3275
3264
|
* Captures a message event and sends it to Sentry.
|
|
3276
3265
|
*
|
|
3277
3266
|
* @param message The message to send to Sentry.
|
|
3278
|
-
* @param
|
|
3267
|
+
* @param Severity Define the level of the message.
|
|
3279
3268
|
* @returns The generated eventId.
|
|
3280
3269
|
*/
|
|
3281
3270
|
function captureMessage(message, captureContext) {
|
|
@@ -3872,10 +3861,7 @@ var Sentry = (function (exports) {
|
|
|
3872
3861
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3873
3862
|
normalized.contexts.trace = event.contexts.trace;
|
|
3874
3863
|
}
|
|
3875
|
-
|
|
3876
|
-
if (_experiments.ensureNoCircularStructures) {
|
|
3877
|
-
return normalize(normalized);
|
|
3878
|
-
}
|
|
3864
|
+
event.sdkProcessingMetadata = Object.assign(Object.assign({}, event.sdkProcessingMetadata), { baseClientNormalized: true });
|
|
3879
3865
|
return normalized;
|
|
3880
3866
|
}
|
|
3881
3867
|
/**
|
|
@@ -4131,31 +4117,6 @@ var Sentry = (function (exports) {
|
|
|
4131
4117
|
}
|
|
4132
4118
|
}
|
|
4133
4119
|
|
|
4134
|
-
/*! *****************************************************************************
|
|
4135
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4136
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4137
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
4138
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4139
|
-
|
|
4140
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
4141
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
4142
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
4143
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
4144
|
-
|
|
4145
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
4146
|
-
and limitations under the License.
|
|
4147
|
-
***************************************************************************** */
|
|
4148
|
-
|
|
4149
|
-
function __rest(s, e) {
|
|
4150
|
-
var t = {};
|
|
4151
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4152
|
-
t[p] = s[p];
|
|
4153
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4154
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
4155
|
-
t[p[i]] = s[p[i]];
|
|
4156
|
-
return t;
|
|
4157
|
-
}
|
|
4158
|
-
|
|
4159
4120
|
/** Extract sdk info from from the API metadata */
|
|
4160
4121
|
function getSdkMetadataForEnvelopeHeader(api) {
|
|
4161
4122
|
if (!api.metadata || !api.metadata.sdk) {
|
|
@@ -4199,16 +4160,58 @@ var Sentry = (function (exports) {
|
|
|
4199
4160
|
const sdkInfo = getSdkMetadataForEnvelopeHeader(api);
|
|
4200
4161
|
const eventType = event.type || 'event';
|
|
4201
4162
|
const useEnvelope = eventType === 'transaction' || !!api.tunnel;
|
|
4202
|
-
const
|
|
4163
|
+
const { transactionSampling } = event.sdkProcessingMetadata || {};
|
|
4203
4164
|
const { method: samplingMethod, rate: sampleRate } = transactionSampling || {};
|
|
4204
|
-
|
|
4205
|
-
|
|
4165
|
+
// TODO: Below is a temporary hack in order to debug a serialization error - see
|
|
4166
|
+
// https://github.com/getsentry/sentry-javascript/issues/2809 and
|
|
4167
|
+
// https://github.com/getsentry/sentry-javascript/pull/4425. TL;DR: even though we normalize all events (which should
|
|
4168
|
+
// prevent this), something is causing `JSON.stringify` to throw a circular reference error.
|
|
4169
|
+
//
|
|
4170
|
+
// When it's time to remove it:
|
|
4171
|
+
// 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting
|
|
4172
|
+
// `sdkProcessingMetadata`
|
|
4173
|
+
// 2. Restore the original version of the request body, which is commented out
|
|
4174
|
+
// 3. Search for `skippedNormalization` and pull out the companion hack in the browser playwright tests
|
|
4175
|
+
enhanceEventWithSdkInfo(event, api.metadata.sdk);
|
|
4176
|
+
event.tags = event.tags || {};
|
|
4177
|
+
event.extra = event.extra || {};
|
|
4178
|
+
// In theory, all events should be marked as having gone through normalization and so
|
|
4179
|
+
// we should never set this tag
|
|
4180
|
+
if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {
|
|
4181
|
+
event.tags.skippedNormalization = true;
|
|
4182
|
+
}
|
|
4183
|
+
// prevent this data from being sent to sentry
|
|
4184
|
+
// TODO: This is NOT part of the hack - DO NOT DELETE
|
|
4185
|
+
delete event.sdkProcessingMetadata;
|
|
4186
|
+
let body;
|
|
4187
|
+
try {
|
|
4188
|
+
// 99.9% of events should get through just fine - no change in behavior for them
|
|
4189
|
+
body = JSON.stringify(event);
|
|
4206
4190
|
}
|
|
4207
|
-
|
|
4208
|
-
event
|
|
4191
|
+
catch (err) {
|
|
4192
|
+
// Record data about the error without replacing original event data, then force renormalization
|
|
4193
|
+
event.tags.JSONStringifyError = true;
|
|
4194
|
+
event.extra.JSONStringifyError = err;
|
|
4195
|
+
try {
|
|
4196
|
+
body = JSON.stringify(normalize(event));
|
|
4197
|
+
}
|
|
4198
|
+
catch (newErr) {
|
|
4199
|
+
// At this point even renormalization hasn't worked, meaning something about the event data has gone very wrong.
|
|
4200
|
+
// Time to cut our losses and record only the new error. With luck, even in the problematic cases we're trying to
|
|
4201
|
+
// debug with this hack, we won't ever land here.
|
|
4202
|
+
const innerErr = newErr;
|
|
4203
|
+
body = JSON.stringify({
|
|
4204
|
+
message: 'JSON.stringify error after renormalization',
|
|
4205
|
+
// setting `extra: { innerErr }` here for some reason results in an empty object, so unpack manually
|
|
4206
|
+
extra: { message: innerErr.message, stack: innerErr.stack },
|
|
4207
|
+
});
|
|
4208
|
+
}
|
|
4209
4209
|
}
|
|
4210
4210
|
const req = {
|
|
4211
|
-
|
|
4211
|
+
// this is the relevant line of code before the hack was added, to make it easy to undo said hack once we've solved
|
|
4212
|
+
// the mystery
|
|
4213
|
+
// body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event),
|
|
4214
|
+
body,
|
|
4212
4215
|
type: eventType,
|
|
4213
4216
|
url: useEnvelope
|
|
4214
4217
|
? getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel)
|
|
@@ -4257,7 +4260,7 @@ var Sentry = (function (exports) {
|
|
|
4257
4260
|
hub.bindClient(client);
|
|
4258
4261
|
}
|
|
4259
4262
|
|
|
4260
|
-
const SDK_VERSION = '6.17.
|
|
4263
|
+
const SDK_VERSION = '6.17.3';
|
|
4261
4264
|
|
|
4262
4265
|
let originalFunctionToString;
|
|
4263
4266
|
/** Patch toString calls to return proper name for wrapped functions */
|
|
@@ -4832,7 +4835,7 @@ var Sentry = (function (exports) {
|
|
|
4832
4835
|
}
|
|
4833
4836
|
|
|
4834
4837
|
/**
|
|
4835
|
-
*
|
|
4838
|
+
* Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
|
|
4836
4839
|
* @hidden
|
|
4837
4840
|
*/
|
|
4838
4841
|
function eventFromException(options, exception, hint) {
|
|
@@ -4841,7 +4844,7 @@ var Sentry = (function (exports) {
|
|
|
4841
4844
|
attachStacktrace: options.attachStacktrace,
|
|
4842
4845
|
});
|
|
4843
4846
|
addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
|
|
4844
|
-
event.level =
|
|
4847
|
+
event.level = exports.Severity.Error;
|
|
4845
4848
|
if (hint && hint.event_id) {
|
|
4846
4849
|
event.event_id = hint.event_id;
|
|
4847
4850
|
}
|
|
@@ -4851,7 +4854,7 @@ var Sentry = (function (exports) {
|
|
|
4851
4854
|
* Builds and Event from a Message
|
|
4852
4855
|
* @hidden
|
|
4853
4856
|
*/
|
|
4854
|
-
function eventFromMessage(options, message, level =
|
|
4857
|
+
function eventFromMessage(options, message, level = exports.Severity.Info, hint) {
|
|
4855
4858
|
const syntheticException = (hint && hint.syntheticException) || undefined;
|
|
4856
4859
|
const event = eventFromString(message, syntheticException, {
|
|
4857
4860
|
attachStacktrace: options.attachStacktrace,
|
|
@@ -4904,11 +4907,11 @@ var Sentry = (function (exports) {
|
|
|
4904
4907
|
return event;
|
|
4905
4908
|
}
|
|
4906
4909
|
if (isPlainObject(exception) || isEvent(exception)) {
|
|
4907
|
-
// If it
|
|
4908
|
-
// This will allow us to group events based on top-level keys
|
|
4909
|
-
//
|
|
4910
|
+
// If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
|
|
4911
|
+
// it manually. This will allow us to group events based on top-level keys which is much better than creating a new
|
|
4912
|
+
// group on any key/value change.
|
|
4910
4913
|
const objectException = exception;
|
|
4911
|
-
event = eventFromPlainObject(objectException, syntheticException, options.
|
|
4914
|
+
event = eventFromPlainObject(objectException, syntheticException, options.isRejection);
|
|
4912
4915
|
addExceptionMechanism(event, {
|
|
4913
4916
|
synthetic: true,
|
|
4914
4917
|
});
|
|
@@ -5235,9 +5238,9 @@ var Sentry = (function (exports) {
|
|
|
5235
5238
|
const options = {
|
|
5236
5239
|
body: sentryRequest.body,
|
|
5237
5240
|
method: 'POST',
|
|
5238
|
-
// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
|
|
5239
|
-
// https://caniuse.com/#feat=referrer-policy
|
|
5240
|
-
//
|
|
5241
|
+
// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
|
|
5242
|
+
// (see https://caniuse.com/#feat=referrer-policy),
|
|
5243
|
+
// it doesn't. And it throws an exception instead of ignoring this parameter...
|
|
5241
5244
|
// REF: https://github.com/getsentry/raven-js/issues/1233
|
|
5242
5245
|
referrerPolicy: (supportsReferrerPolicy() ? 'origin' : ''),
|
|
5243
5246
|
};
|
|
@@ -5350,7 +5353,7 @@ var Sentry = (function (exports) {
|
|
|
5350
5353
|
/**
|
|
5351
5354
|
* @inheritDoc
|
|
5352
5355
|
*/
|
|
5353
|
-
eventFromMessage(message, level =
|
|
5356
|
+
eventFromMessage(message, level = exports.Severity.Info, hint) {
|
|
5354
5357
|
return eventFromMessage(this._options, message, level, hint);
|
|
5355
5358
|
}
|
|
5356
5359
|
/**
|
|
@@ -5580,7 +5583,7 @@ var Sentry = (function (exports) {
|
|
|
5580
5583
|
? _eventFromIncompleteOnError(msg, url, line, column)
|
|
5581
5584
|
: _enhanceEventWithInitialFrame(eventFromUnknownInput(error || msg, undefined, {
|
|
5582
5585
|
attachStacktrace,
|
|
5583
|
-
|
|
5586
|
+
isRejection: false,
|
|
5584
5587
|
}), url, line, column);
|
|
5585
5588
|
addMechanismAndCapture(hub, error, event, 'onerror');
|
|
5586
5589
|
});
|
|
@@ -5621,9 +5624,9 @@ var Sentry = (function (exports) {
|
|
|
5621
5624
|
? _eventFromRejectionWithPrimitive(error)
|
|
5622
5625
|
: eventFromUnknownInput(error, undefined, {
|
|
5623
5626
|
attachStacktrace,
|
|
5624
|
-
|
|
5627
|
+
isRejection: true,
|
|
5625
5628
|
});
|
|
5626
|
-
event.level =
|
|
5629
|
+
event.level = exports.Severity.Error;
|
|
5627
5630
|
addMechanismAndCapture(hub, error, event, 'onunhandledrejection');
|
|
5628
5631
|
return;
|
|
5629
5632
|
});
|
|
@@ -6110,7 +6113,7 @@ var Sentry = (function (exports) {
|
|
|
6110
6113
|
getCurrentHub().addBreadcrumb({
|
|
6111
6114
|
category: 'fetch',
|
|
6112
6115
|
data: handlerData.fetchData,
|
|
6113
|
-
level:
|
|
6116
|
+
level: exports.Severity.Error,
|
|
6114
6117
|
type: 'http',
|
|
6115
6118
|
}, {
|
|
6116
6119
|
data: handlerData.error,
|