@sentry/core
Advanced tools
Comparing version 5.16.0-beta.3 to 5.16.0-beta.4
@@ -137,2 +137,7 @@ import { Scope } from '@sentry/hub'; | ||
/** | ||
* Tells the backend to send this event | ||
* @param event The Sentry event to send | ||
*/ | ||
protected _sendEvent(event: Event): void; | ||
/** | ||
* Processes an event (either error or message) and sends it to Sentry. | ||
@@ -139,0 +144,0 @@ * |
@@ -64,11 +64,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
.eventFromException(exception, hint) | ||
.then(function (event) { return _this._processEvent(event, hint, scope); }) | ||
.then(function (finalEvent) { | ||
// We need to check for finalEvent in case beforeSend returned null | ||
eventId = finalEvent && finalEvent.event_id; | ||
_this._processing = false; | ||
}) | ||
.then(null, function (reason) { | ||
utils_1.logger.error(reason); | ||
_this._processing = false; | ||
.then(function (event) { | ||
eventId = _this.captureEvent(event, hint, scope); | ||
}); | ||
@@ -87,12 +80,4 @@ return eventId; | ||
: this._getBackend().eventFromException(message, hint); | ||
promisedEvent | ||
.then(function (event) { return _this._processEvent(event, hint, scope); }) | ||
.then(function (finalEvent) { | ||
// We need to check for finalEvent in case beforeSend returned null | ||
eventId = finalEvent && finalEvent.event_id; | ||
_this._processing = false; | ||
}) | ||
.then(null, function (reason) { | ||
utils_1.logger.error(reason); | ||
_this._processing = false; | ||
promisedEvent.then(function (event) { | ||
eventId = _this.captureEvent(event, hint, scope); | ||
}); | ||
@@ -309,2 +294,9 @@ return eventId; | ||
/** | ||
* Tells the backend to send this event | ||
* @param event The Sentry event to send | ||
*/ | ||
BaseClient.prototype._sendEvent = function (event) { | ||
this._getBackend().sendEvent(event); | ||
}; | ||
/** | ||
* Processes an event (either error or message) and sends it to Sentry. | ||
@@ -328,5 +320,7 @@ * | ||
} | ||
var isTransaction = event.type === 'transaction'; | ||
// 1.0 === 100% events are sent | ||
// 0.0 === 0% events are sent | ||
if (typeof sampleRate === 'number' && Math.random() > sampleRate) { | ||
// Sampling for transaction happens somewhere else | ||
if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) { | ||
return utils_1.SyncPromise.reject('This event has been sampled, will not send event.'); | ||
@@ -343,4 +337,5 @@ } | ||
var isInternalException = hint && hint.data && hint.data.__sentry__ === true; | ||
if (isInternalException || !beforeSend) { | ||
_this._getBackend().sendEvent(finalEvent); | ||
// We skip beforeSend in case of transactions | ||
if (isInternalException || !beforeSend || isTransaction) { | ||
_this._sendEvent(finalEvent); | ||
resolve(finalEvent); | ||
@@ -365,3 +360,3 @@ return; | ||
// From here on we are really async | ||
_this._getBackend().sendEvent(finalEvent); | ||
_this._sendEvent(finalEvent); | ||
resolve(finalEvent); | ||
@@ -393,3 +388,3 @@ } | ||
// From here on we are really async | ||
_this._getBackend().sendEvent(processedEvent); | ||
_this._sendEvent(processedEvent); | ||
resolve(processedEvent); | ||
@@ -396,0 +391,0 @@ }) |
@@ -1,2 +0,2 @@ | ||
export { addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from '@sentry/minimal'; | ||
export { addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from '@sentry/minimal'; | ||
export { addGlobalEventProcessor, getCurrentHub, getHubFromCarrier, Hub, Scope } from '@sentry/hub'; | ||
@@ -3,0 +3,0 @@ export { API } from './api'; |
@@ -8,2 +8,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.configureScope = minimal_1.configureScope; | ||
exports.startTransaction = minimal_1.startTransaction; | ||
exports.setContext = minimal_1.setContext; | ||
@@ -10,0 +11,0 @@ exports.setExtra = minimal_1.setExtra; |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var hub_1 = require("@sentry/hub"); | ||
var utils_1 = require("@sentry/utils"); | ||
/** Creates a SentryRequest from an event. */ | ||
function eventToSentryRequest(event, api) { | ||
var client = hub_1.getCurrentHub().getClient(); | ||
var experimentsOptions = (client && client.getOptions()._experiments) || {}; | ||
var useEnvelope = event.type === 'transaction' && experimentsOptions.useEnvelope; | ||
var useEnvelope = event.type === 'transaction'; | ||
var req = { | ||
@@ -10,0 +7,0 @@ body: JSON.stringify(event), |
@@ -137,2 +137,7 @@ import { Scope } from '@sentry/hub'; | ||
/** | ||
* Tells the backend to send this event | ||
* @param event The Sentry event to send | ||
*/ | ||
protected _sendEvent(event: Event): void; | ||
/** | ||
* Processes an event (either error or message) and sends it to Sentry. | ||
@@ -139,0 +144,0 @@ * |
@@ -63,11 +63,4 @@ import * as tslib_1 from "tslib"; | ||
.eventFromException(exception, hint) | ||
.then(function (event) { return _this._processEvent(event, hint, scope); }) | ||
.then(function (finalEvent) { | ||
// We need to check for finalEvent in case beforeSend returned null | ||
eventId = finalEvent && finalEvent.event_id; | ||
_this._processing = false; | ||
}) | ||
.then(null, function (reason) { | ||
logger.error(reason); | ||
_this._processing = false; | ||
.then(function (event) { | ||
eventId = _this.captureEvent(event, hint, scope); | ||
}); | ||
@@ -86,12 +79,4 @@ return eventId; | ||
: this._getBackend().eventFromException(message, hint); | ||
promisedEvent | ||
.then(function (event) { return _this._processEvent(event, hint, scope); }) | ||
.then(function (finalEvent) { | ||
// We need to check for finalEvent in case beforeSend returned null | ||
eventId = finalEvent && finalEvent.event_id; | ||
_this._processing = false; | ||
}) | ||
.then(null, function (reason) { | ||
logger.error(reason); | ||
_this._processing = false; | ||
promisedEvent.then(function (event) { | ||
eventId = _this.captureEvent(event, hint, scope); | ||
}); | ||
@@ -308,2 +293,9 @@ return eventId; | ||
/** | ||
* Tells the backend to send this event | ||
* @param event The Sentry event to send | ||
*/ | ||
BaseClient.prototype._sendEvent = function (event) { | ||
this._getBackend().sendEvent(event); | ||
}; | ||
/** | ||
* Processes an event (either error or message) and sends it to Sentry. | ||
@@ -327,5 +319,7 @@ * | ||
} | ||
var isTransaction = event.type === 'transaction'; | ||
// 1.0 === 100% events are sent | ||
// 0.0 === 0% events are sent | ||
if (typeof sampleRate === 'number' && Math.random() > sampleRate) { | ||
// Sampling for transaction happens somewhere else | ||
if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) { | ||
return SyncPromise.reject('This event has been sampled, will not send event.'); | ||
@@ -342,4 +336,5 @@ } | ||
var isInternalException = hint && hint.data && hint.data.__sentry__ === true; | ||
if (isInternalException || !beforeSend) { | ||
_this._getBackend().sendEvent(finalEvent); | ||
// We skip beforeSend in case of transactions | ||
if (isInternalException || !beforeSend || isTransaction) { | ||
_this._sendEvent(finalEvent); | ||
resolve(finalEvent); | ||
@@ -364,3 +359,3 @@ return; | ||
// From here on we are really async | ||
_this._getBackend().sendEvent(finalEvent); | ||
_this._sendEvent(finalEvent); | ||
resolve(finalEvent); | ||
@@ -392,3 +387,3 @@ } | ||
// From here on we are really async | ||
_this._getBackend().sendEvent(processedEvent); | ||
_this._sendEvent(processedEvent); | ||
resolve(processedEvent); | ||
@@ -395,0 +390,0 @@ }) |
@@ -1,2 +0,2 @@ | ||
export { addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from '@sentry/minimal'; | ||
export { addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from '@sentry/minimal'; | ||
export { addGlobalEventProcessor, getCurrentHub, getHubFromCarrier, Hub, Scope } from '@sentry/hub'; | ||
@@ -3,0 +3,0 @@ export { API } from './api'; |
@@ -1,2 +0,2 @@ | ||
export { addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from '@sentry/minimal'; | ||
export { addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from '@sentry/minimal'; | ||
export { addGlobalEventProcessor, getCurrentHub, getHubFromCarrier, Hub, Scope } from '@sentry/hub'; | ||
@@ -3,0 +3,0 @@ export { API } from './api'; |
@@ -1,8 +0,5 @@ | ||
import { getCurrentHub } from '@sentry/hub'; | ||
import { timestampWithMs } from '@sentry/utils'; | ||
/** Creates a SentryRequest from an event. */ | ||
export function eventToSentryRequest(event, api) { | ||
var client = getCurrentHub().getClient(); | ||
var experimentsOptions = (client && client.getOptions()._experiments) || {}; | ||
var useEnvelope = event.type === 'transaction' && experimentsOptions.useEnvelope; | ||
var useEnvelope = event.type === 'transaction'; | ||
var req = { | ||
@@ -9,0 +6,0 @@ body: JSON.stringify(event), |
{ | ||
"name": "@sentry/core", | ||
"version": "5.16.0-beta.3", | ||
"version": "5.16.0-beta.4", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -19,6 +19,6 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/hub": "5.16.0-beta.3", | ||
"@sentry/minimal": "5.16.0-beta.3", | ||
"@sentry/types": "5.16.0-beta.3", | ||
"@sentry/utils": "5.16.0-beta.3", | ||
"@sentry/hub": "5.16.0-beta.4", | ||
"@sentry/minimal": "5.16.0-beta.4", | ||
"@sentry/types": "5.16.0-beta.4", | ||
"@sentry/utils": "5.16.0-beta.4", | ||
"tslib": "^1.9.3" | ||
@@ -25,0 +25,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
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
251180
2640
+ Added@sentry/hub@5.16.0-beta.4(transitive)
+ Added@sentry/minimal@5.16.0-beta.4(transitive)
+ Added@sentry/types@5.16.0-beta.4(transitive)
+ Added@sentry/utils@5.16.0-beta.4(transitive)
- Removed@sentry/hub@5.16.0-beta.3(transitive)
- Removed@sentry/minimal@5.16.0-beta.3(transitive)
- Removed@sentry/types@5.16.0-beta.3(transitive)
- Removed@sentry/utils@5.16.0-beta.3(transitive)
Updated@sentry/hub@5.16.0-beta.4
Updated@sentry/types@5.16.0-beta.4
Updated@sentry/utils@5.16.0-beta.4