Skip to content

Commit 9b0e284

Browse files
committed
Adding a callback to check if the item should be sent or not
This allows rate limiting implementations or other things outside of the core lib. Fixes #92
1 parent 9b2887b commit 9b0e284

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/raven.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@ function send(data) {
501501
data = globalOptions.dataCallback(data);
502502
}
503503

504+
// Check if the request should be filtered or not
505+
if (isFunction(globalOptions.shouldSendCallback) && !globalOptions.shouldSendCallback(data)) {
506+
return;
507+
}
508+
504509
makeRequest(data);
505510
}
506511

0 commit comments

Comments
 (0)