Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,17 +687,23 @@ function send(data) {
data = globalOptions.dataCallback(data);
}

// Check if the request should be filtered or not
if (isFunction(globalOptions.shouldSendCallback) && !globalOptions.shouldSendCallback(data)) {
return;
var shouldSend = function (should) {
if (should) {
// Send along an event_id if not explicitly passed.
// This event_id can be used to reference the error within Sentry itself.
// Set lastEventId after we know the error should actually be sent
lastEventId = data.event_id || (data.event_id = uuid4());

makeRequest(data);
}
}

// Send along an event_id if not explicitly passed.
// This event_id can be used to reference the error within Sentry itself.
// Set lastEventId after we know the error should actually be sent
lastEventId = data.event_id || (data.event_id = uuid4());

makeRequest(data);
// Check if the request should be filtered or not
if (isFunction(globalOptions.shouldSendCallback)) {
globalOptions.shouldSendCallback(data, shouldSend);
} else {
shouldSend(true);
}
}


Expand Down