diff --git a/lib/protos.js b/lib/protos.js index 2fdd5b4..12c885b 100644 --- a/lib/protos.js +++ b/lib/protos.js @@ -174,16 +174,9 @@ exports.invoke = function(method) { if (!this[method]) return; var args = Array.prototype.slice.call(arguments, 1); if (!this._ready) return this.queue(method, args); - var ret; - try { - this.debug('%s with %o', method, args); - ret = this[method].apply(this, args); - } catch (e) { - this.debug('error %o calling %s with %o', e, method, args); - } - - return ret; + this.debug('%s with %o', method, args); + return this[method].apply(this, args); }; /** diff --git a/test/index.test.js b/test/index.test.js index 42913ef..fcff17e 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -299,10 +299,12 @@ describe('integration', function() { assert(integration.track.calledWith('event')); }); - it('should catch errors when it calls', function() { + it('should throw errors if the integration errors', function() { integration.emit('ready'); integration.initialize(); - integration.invoke('page', 'name'); + assert['throws'](function() { + integration.invoke('page', 'name'); + }, Error, 'Should not swallow exceptions'); }); it('should return the returned value', function(done) {