Skip to content

Commit

Permalink
if RollbarProxy is defined, use the proxy to send all Rollbar events
Browse files Browse the repository at this point in the history
  • Loading branch information
waltjones committed Apr 11, 2019
1 parent a4fa6f2 commit d3d756a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/browser/transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,23 @@ function _makeZoneRequest(accessToken, url, method, data, callback, requestFacto
}
}

/* global RollbarProxy */
function _proxyRequest(json, callback) {
var rollbarProxy = new RollbarProxy();
rollbarProxy.send(
json,
function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars
function(err) {
callback(new Error(err));
}
);
}

function _makeRequest(accessToken, url, method, data, callback, requestFactory) {
if (typeof RollbarProxy !== 'undefined') {
return _proxyRequest(data, callback);
}

var request;
if (requestFactory) {
request = requestFactory();
Expand Down

0 comments on commit d3d756a

Please sign in to comment.