@sentry/core
Advanced tools
Comparing version 4.5.2 to 4.5.3
@@ -6,3 +6,4 @@ "use strict"; | ||
var is_1 = require("@sentry/utils/is"); | ||
var logger_1 = require("../../../utils/logger"); | ||
var logger_1 = require("@sentry/utils/logger"); | ||
var object_1 = require("@sentry/utils/object"); | ||
/** Patch toString calls to return proper name for wrapped functions */ | ||
@@ -41,3 +42,8 @@ var ExtraErrorData = /** @class */ (function () { | ||
if (errorData) { | ||
return tslib_1.__assign({}, event, { extra: tslib_1.__assign({}, event.extra, errorData) }); | ||
var extra = tslib_1.__assign({}, event.extra); | ||
var normalizedErrorData = object_1.safeNormalize(errorData); | ||
if (!is_1.isString(normalizedErrorData)) { | ||
extra = tslib_1.__assign({}, event.extra, normalizedErrorData); | ||
} | ||
return tslib_1.__assign({}, event, { extra: extra }); | ||
} | ||
@@ -51,2 +57,3 @@ return event; | ||
var e_1, _a, _b; | ||
var result = null; | ||
// We are trying to enhance already existing event, so no harm done if it won't succeed | ||
@@ -76,12 +83,11 @@ try { | ||
} | ||
return _b = {}, | ||
result = (_b = {}, | ||
_b[name_1] = extraErrorInfo, | ||
_b; | ||
_b); | ||
} | ||
return null; | ||
} | ||
catch (oO) { | ||
logger_1.logger.error('Unable to extract extra data from the Error object:', oO); | ||
return null; | ||
} | ||
return result; | ||
}; | ||
@@ -88,0 +94,0 @@ /** |
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub/esm'; | ||
import { isError } from '@sentry/utils/esm/is'; | ||
import { logger } from '../../../utils/logger'; | ||
import { isError, isString } from '@sentry/utils/esm/is'; | ||
import { logger } from '@sentry/utils/esm/logger'; | ||
import { safeNormalize } from '@sentry/utils/esm/object'; | ||
/** Patch toString calls to return proper name for wrapped functions */ | ||
@@ -33,8 +34,15 @@ export class ExtraErrorData { | ||
if (errorData) { | ||
let extra = { | ||
...event.extra, | ||
}; | ||
const normalizedErrorData = safeNormalize(errorData); | ||
if (!isString(normalizedErrorData)) { | ||
extra = { | ||
...event.extra, | ||
...normalizedErrorData, | ||
}; | ||
} | ||
return { | ||
...event, | ||
extra: { | ||
...event.extra, | ||
...errorData, | ||
}, | ||
extra, | ||
}; | ||
@@ -48,2 +56,3 @@ } | ||
extractErrorData(error) { | ||
let result = null; | ||
// We are trying to enhance already existing event, so no harm done if it won't succeed | ||
@@ -63,12 +72,11 @@ try { | ||
} | ||
return { | ||
result = { | ||
[name]: extraErrorInfo, | ||
}; | ||
} | ||
return null; | ||
} | ||
catch (oO) { | ||
logger.error('Unable to extract extra data from the Error object:', oO); | ||
return null; | ||
} | ||
return result; | ||
} | ||
@@ -75,0 +83,0 @@ } |
{ | ||
"name": "@sentry/core", | ||
"version": "4.5.2", | ||
"version": "4.5.3", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -18,6 +18,6 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/hub": "4.5.2", | ||
"@sentry/minimal": "4.5.2", | ||
"@sentry/types": "4.5.0", | ||
"@sentry/utils": "4.5.2", | ||
"@sentry/hub": "4.5.3", | ||
"@sentry/minimal": "4.5.3", | ||
"@sentry/types": "4.5.3", | ||
"@sentry/utils": "4.5.3", | ||
"tslib": "^1.9.3" | ||
@@ -72,4 +72,3 @@ }, | ||
}, | ||
"gitHead": "a91da22f8bd3bddb38fab7f868326e376da82d4d", | ||
"sideEffects": false | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
381795
4679
+ Added@sentry/hub@4.5.3(transitive)
+ Added@sentry/minimal@4.5.3(transitive)
+ Added@sentry/types@4.5.3(transitive)
+ Added@sentry/utils@4.5.3(transitive)
- Removed@sentry/hub@4.5.2(transitive)
- Removed@sentry/minimal@4.5.2(transitive)
- Removed@sentry/types@4.5.0(transitive)
- Removed@sentry/utils@4.5.2(transitive)
Updated@sentry/hub@4.5.3
Updated@sentry/minimal@4.5.3
Updated@sentry/types@4.5.3
Updated@sentry/utils@4.5.3