@sentry/browser
Advanced tools
Comparing version 8.33.1 to 8.34.0-internal.0
@@ -14,3 +14,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const exception = { | ||
type: ex && ex.name, | ||
type: extractType(ex), | ||
value: extractMessage(ex), | ||
@@ -141,3 +141,35 @@ }; | ||
// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception | ||
// @ts-expect-error - WebAssembly.Exception is a valid class | ||
function isWebAssemblyException(exception) { | ||
// Check for support | ||
// @ts-expect-error - WebAssembly.Exception is a valid class | ||
if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') { | ||
// @ts-expect-error - WebAssembly.Exception is a valid class | ||
return exception instanceof WebAssembly.Exception; | ||
} else { | ||
return false; | ||
} | ||
} | ||
/** | ||
* Extracts from errors what we use as the exception `type` in error events. | ||
* | ||
* Usually, this is the `name` property on Error objects but WASM errors need to be treated differently. | ||
*/ | ||
function extractType(ex) { | ||
const name = ex && ex.name; | ||
// The name for WebAssembly.Exception Errors needs to be extracted differently. | ||
// Context: https://github.com/getsentry/sentry-javascript/issues/13787 | ||
if (!name && isWebAssemblyException(ex)) { | ||
// Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object | ||
const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2; | ||
return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception'; | ||
} | ||
return name; | ||
} | ||
/** | ||
* There are cases where stacktrace.message is an Event object | ||
@@ -149,8 +181,16 @@ * https://github.com/getsentry/sentry-javascript/issues/1949 | ||
const message = ex && ex.message; | ||
if (!message) { | ||
return 'No error message'; | ||
} | ||
if (message.error && typeof message.error.message === 'string') { | ||
return message.error.message; | ||
} | ||
// Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object | ||
if (isWebAssemblyException(ex) && Array.isArray(ex.message) && ex.message.length == 2) { | ||
return ex.message[1]; | ||
} | ||
return message; | ||
@@ -355,2 +395,4 @@ } | ||
exports.exceptionFromError = exceptionFromError; | ||
exports.extractMessage = extractMessage; | ||
exports.extractType = extractType; | ||
//# sourceMappingURL=eventbuilder.js.map |
@@ -12,3 +12,3 @@ import { getClient } from '@sentry/core'; | ||
const exception = { | ||
type: ex && ex.name, | ||
type: extractType(ex), | ||
value: extractMessage(ex), | ||
@@ -139,3 +139,35 @@ }; | ||
// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception | ||
// @ts-expect-error - WebAssembly.Exception is a valid class | ||
function isWebAssemblyException(exception) { | ||
// Check for support | ||
// @ts-expect-error - WebAssembly.Exception is a valid class | ||
if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') { | ||
// @ts-expect-error - WebAssembly.Exception is a valid class | ||
return exception instanceof WebAssembly.Exception; | ||
} else { | ||
return false; | ||
} | ||
} | ||
/** | ||
* Extracts from errors what we use as the exception `type` in error events. | ||
* | ||
* Usually, this is the `name` property on Error objects but WASM errors need to be treated differently. | ||
*/ | ||
function extractType(ex) { | ||
const name = ex && ex.name; | ||
// The name for WebAssembly.Exception Errors needs to be extracted differently. | ||
// Context: https://github.com/getsentry/sentry-javascript/issues/13787 | ||
if (!name && isWebAssemblyException(ex)) { | ||
// Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object | ||
const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2; | ||
return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception'; | ||
} | ||
return name; | ||
} | ||
/** | ||
* There are cases where stacktrace.message is an Event object | ||
@@ -147,8 +179,16 @@ * https://github.com/getsentry/sentry-javascript/issues/1949 | ||
const message = ex && ex.message; | ||
if (!message) { | ||
return 'No error message'; | ||
} | ||
if (message.error && typeof message.error.message === 'string') { | ||
return message.error.message; | ||
} | ||
// Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object | ||
if (isWebAssemblyException(ex) && Array.isArray(ex.message) && ex.message.length == 2) { | ||
return ex.message[1]; | ||
} | ||
return message; | ||
@@ -349,3 +389,3 @@ } | ||
export { eventFromException, eventFromMessage, eventFromUnknownInput, exceptionFromError }; | ||
export { eventFromException, eventFromMessage, eventFromUnknownInput, exceptionFromError, extractMessage, extractType }; | ||
//# sourceMappingURL=eventbuilder.js.map |
@@ -7,2 +7,22 @@ import { Event, EventHint, Exception, ParameterizedString, SeverityLevel, StackParser } from '@sentry/types'; | ||
/** | ||
* Extracts from errors what we use as the exception `type` in error events. | ||
* | ||
* Usually, this is the `name` property on Error objects but WASM errors need to be treated differently. | ||
*/ | ||
export declare function extractType(ex: Error & { | ||
message: { | ||
error?: Error; | ||
}; | ||
}): string | undefined; | ||
/** | ||
* There are cases where stacktrace.message is an Event object | ||
* https://github.com/getsentry/sentry-javascript/issues/1949 | ||
* In this specific case we try to extract stacktrace.message.error.message | ||
*/ | ||
export declare function extractMessage(ex: Error & { | ||
message: { | ||
error?: Error; | ||
}; | ||
}): string; | ||
/** | ||
* Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. | ||
@@ -9,0 +29,0 @@ * @hidden |
import { browserTracingIntegrationShim, feedbackIntegrationShim, metricsShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
export { replayIntegration, getReplay } from '@sentry-internal/replay'; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration, metricsShim as metrics, }; | ||
//# sourceMappingURL=index.bundle.replay.d.ts.map |
@@ -7,3 +7,3 @@ export * from './index.bundle.base'; | ||
export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration }; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
export { replayIntegration, getReplay } from '@sentry-internal/replay'; | ||
//# sourceMappingURL=index.bundle.tracing.replay.d.ts.map |
@@ -8,3 +8,3 @@ export * from './index.bundle.base'; | ||
export { feedbackAsyncIntegration as feedbackAsyncIntegration, feedbackAsyncIntegration as feedbackIntegration }; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
export { replayIntegration, getReplay } from '@sentry-internal/replay'; | ||
//# sourceMappingURL=index.bundle.tracing.replay.feedback.d.ts.map |
@@ -7,2 +7,22 @@ import type { Event, EventHint, Exception, ParameterizedString, SeverityLevel, StackParser } from '@sentry/types'; | ||
/** | ||
* Extracts from errors what we use as the exception `type` in error events. | ||
* | ||
* Usually, this is the `name` property on Error objects but WASM errors need to be treated differently. | ||
*/ | ||
export declare function extractType(ex: Error & { | ||
message: { | ||
error?: Error; | ||
}; | ||
}): string | undefined; | ||
/** | ||
* There are cases where stacktrace.message is an Event object | ||
* https://github.com/getsentry/sentry-javascript/issues/1949 | ||
* In this specific case we try to extract stacktrace.message.error.message | ||
*/ | ||
export declare function extractMessage(ex: Error & { | ||
message: { | ||
error?: Error; | ||
}; | ||
}): string; | ||
/** | ||
* Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. | ||
@@ -9,0 +29,0 @@ * @hidden |
import { browserTracingIntegrationShim, feedbackIntegrationShim, metricsShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
export { replayIntegration, getReplay } from '@sentry-internal/replay'; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration, metricsShim as metrics, }; | ||
//# sourceMappingURL=index.bundle.replay.d.ts.map |
@@ -7,3 +7,3 @@ export * from './index.bundle.base'; | ||
export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration }; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
export { replayIntegration, getReplay } from '@sentry-internal/replay'; | ||
//# sourceMappingURL=index.bundle.tracing.replay.d.ts.map |
@@ -8,3 +8,3 @@ export * from './index.bundle.base'; | ||
export { feedbackAsyncIntegration as feedbackAsyncIntegration, feedbackAsyncIntegration as feedbackIntegration }; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
export { replayIntegration, getReplay } from '@sentry-internal/replay'; | ||
//# sourceMappingURL=index.bundle.tracing.replay.feedback.d.ts.map |
{ | ||
"name": "@sentry/browser", | ||
"version": "8.33.1", | ||
"version": "8.34.0-internal.0", | ||
"description": "Official Sentry SDK for browsers", | ||
@@ -42,12 +42,12 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry-internal/browser-utils": "8.33.1", | ||
"@sentry-internal/feedback": "8.33.1", | ||
"@sentry-internal/replay": "8.33.1", | ||
"@sentry-internal/replay-canvas": "8.33.1", | ||
"@sentry/core": "8.33.1", | ||
"@sentry/types": "8.33.1", | ||
"@sentry/utils": "8.33.1" | ||
"@sentry-internal/browser-utils": "8.34.0-internal.0", | ||
"@sentry-internal/feedback": "8.34.0-internal.0", | ||
"@sentry-internal/replay": "8.34.0-internal.0", | ||
"@sentry-internal/replay-canvas": "8.34.0-internal.0", | ||
"@sentry/core": "8.34.0-internal.0", | ||
"@sentry/types": "8.34.0-internal.0", | ||
"@sentry/utils": "8.34.0-internal.0" | ||
}, | ||
"devDependencies": { | ||
"@sentry-internal/integration-shims": "8.33.1", | ||
"@sentry-internal/integration-shims": "8.34.0-internal.0", | ||
"fake-indexeddb": "^4.0.1" | ||
@@ -54,0 +54,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
983125
9937
1
1
122
+ Added@sentry-internal/browser-utils@8.34.0-internal.0(transitive)
+ Added@sentry-internal/feedback@8.34.0-internal.0(transitive)
+ Added@sentry-internal/replay@8.34.0-internal.0(transitive)
+ Added@sentry-internal/replay-canvas@8.34.0-internal.0(transitive)
+ Added@sentry/core@8.34.0-internal.0(transitive)
+ Added@sentry/types@8.34.0-internal.0(transitive)
+ Added@sentry/utils@8.34.0-internal.0(transitive)
- Removed@sentry-internal/browser-utils@8.33.1(transitive)
- Removed@sentry-internal/feedback@8.33.1(transitive)
- Removed@sentry-internal/replay@8.33.1(transitive)
- Removed@sentry-internal/replay-canvas@8.33.1(transitive)
- Removed@sentry/core@8.33.1(transitive)
- Removed@sentry/types@8.33.1(transitive)
- Removed@sentry/utils@8.33.1(transitive)