Skip to content

Commit 1ebd93b

Browse files
committed
Add Raven.setTransport
1 parent 6c5a52d commit 1ebd93b

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

plugins/react-native.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = function (Raven) {
3030

3131
if (request.status === 200) {
3232
if (options.onSuccess) {
33-
options.onSuccess;
33+
options.onSuccess();
3434
}
3535
} else {
3636
if (options.onError) {

src/raven.js

+15
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,21 @@ var Raven = {
359359
return Raven;
360360
},
361361

362+
/**
363+
* Override the default HTTP transport mechanism that transmits data
364+
* to the Sentry server.
365+
*
366+
* @param {function} transport Function invoked instead of the default
367+
* `makeRequest` handler.
368+
*
369+
* @return {Raven}
370+
*/
371+
setTransport: function(transport) {
372+
globalOptions.transport = transport;
373+
374+
return Raven;
375+
},
376+
362377
/*
363378
* Get the latest raw exception that was captured by Raven.
364379
*

0 commit comments

Comments
 (0)