Socket
Socket
Sign inDemoInstall

raven-js

Package Overview
Dependencies
Maintainers
3
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raven-js - npm Package Compare versions

Comparing version 3.3.0 to 3.4.0

test/plugins/angular.test.js

2

bower.json
{
"name": "raven-js",
"version": "3.3.0",
"version": "3.4.0",
"dependencies": {},

@@ -5,0 +5,0 @@ "main": "dist/raven.js",

# Changelog
## 3.4.0
* CHANGE: React Native plugin now stores errors in AsyncStorage and sends error data on app init. See: https://github.com/getsentry/raven-js/pull/626
* BUGFIX: React Native path normalization regex has been updated. See: https://github.com/getsentry/raven-js/pull/666
* BUGFIX: Angular 1 plugin now extracts errors from minified exception strings. See: https://github.com/getsentry/raven-js/pull/667
## 3.3.0

@@ -4,0 +9,0 @@ * NEW: Can now specify `environment` configuration option. See: https://github.com/getsentry/raven-js/pull/661

@@ -1,2 +0,2 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */

@@ -22,4 +22,5 @@ /*

// See https://github.com/angular/angular.js/blob/v1.4.7/src/minErr.js
var angularPattern = /^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.+?)\n(\S+)$/;
var angularPattern = /^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.*?)\n?(\S+)$/;
function angularPlugin(Raven, angular) {

@@ -55,17 +56,4 @@ angular = angular || window.angular;

Raven.setDataCallback(function(data, original) {
// We only care about mutating an exception
var exception = data.exception;
if (exception) {
exception = exception.values[0];
var matches = angularPattern.exec(exception.value);
angularPlugin._normalizeData(data);
if (matches) {
// This type now becomes something like: $rootScope:inprog
exception.type = matches[1];
exception.value = matches[2];
data.message = exception.type + ': ' + exception.value;
// auto set a new tag specifically for the angular error url
data.extra.angularDocs = matches[3].substr(0, 250);
}
}
original && original(data);

@@ -75,2 +63,21 @@ });

angularPlugin._normalizeData = function (data) {
// We only care about mutating an exception
var exception = data.exception;
if (exception) {
exception = exception.values[0];
var matches = angularPattern.exec(exception.value);
if (matches) {
// This type now becomes something like: $rootScope:inprog
exception.type = matches[1];
exception.value = matches[2];
data.message = exception.type + ': ' + exception.value;
// auto set a new tag specifically for the angular error url
data.extra.angularDocs = matches[3].substr(0, 250);
}
}
};
module.exports = angularPlugin;

@@ -77,0 +84,0 @@

@@ -1,3 +0,3 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b=b.Raven||(b.Raven={}),b=b.Plugins||(b.Plugins={}),b.Angular=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a,b){function c(){this.$get=["$window",function(b){return a}]}function d(a){a.decorator("$exceptionHandler",["Raven","$delegate",f])}function f(a,b){return function(c,d){a.captureException(c,{extra:{cause:d}}),b(c,d)}}b=b||window.angular,b&&(b.module("ngRaven",[]).provider("Raven",c).config(["$provide",d]),a.setDataCallback(function(a,b){var c=a.exception;if(c){c=c.values[0];var d=e.exec(c.value);d&&(c.type=d[1],c.value=d[2],a.message=c.type+": "+c.value,a.extra.angularDocs=d[3].substr(0,250))}b&&b(a)}))}var e=/^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.+?)\n(\S+)$/;b.exports=d},{}]},{},[1])(1)});
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b=b.Raven||(b.Raven={}),b=b.Plugins||(b.Plugins={}),b.Angular=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a,b){function c(){this.$get=["$window",function(b){return a}]}function e(a){a.decorator("$exceptionHandler",["Raven","$delegate",f])}function f(a,b){return function(c,d){a.captureException(c,{extra:{cause:d}}),b(c,d)}}b=b||window.angular,b&&(b.module("ngRaven",[]).provider("Raven",c).config(["$provide",e]),a.setDataCallback(function(a,b){d.a(a),b&&b(a)}))}var e=/^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.*?)\n?(\S+)$/;d.a=function(a){var b=a.exception;if(b){b=b.values[0];var c=e.exec(b.value);c&&(b.type=c[1],b.value=c[2],a.message=b.type+": "+b.value,a.extra.angularDocs=c[3].substr(0,250))}},b.exports=d},{}]},{},[1])(1)});
//# sourceMappingURL=angular.min.js.map

@@ -1,2 +0,2 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */

@@ -3,0 +3,0 @@ /*

@@ -1,3 +0,3 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b=b.Raven||(b.Raven={}),b=b.Plugins||(b.Plugins={}),b.Console=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a,b,c){b=b||window.console||{},c=c||{};for(var d=c.levels||["debug","info","warn","error"],f=d.pop(),g=function(b,c){a.captureMessage(b,c)};f;)e(b,f,g),f=d.pop()}var e=a(2).wrapMethod;b.exports=d},{2:2}],2:[function(a,b,c){"use strict";var d=function(a,b,c){var d=a[b],e=a;if(b in a){var f="warn"===b?"warning":b;a[b]=function(){var a=[].slice.call(arguments),b=""+a.join(" "),g={level:f,logger:"console",extra:{arguments:a}};c&&c(b,g),d&&Function.prototype.apply.call(d,e,a)}}};b.exports={wrapMethod:d}},{}]},{},[1])(1)});
//# sourceMappingURL=console.min.js.map

@@ -1,2 +0,2 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */

@@ -3,0 +3,0 @@ /*

@@ -1,3 +0,3 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b=b.Raven||(b.Raven={}),b=b.Plugins||(b.Plugins={}),b.Ember=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a,b){if(b=b||window.Ember){var c=b.onerror;b.onerror=function(b){a.captureException(b),"function"==typeof c&&c.call(this,b)},b.RSVP.on("error",function(b){b instanceof Error?a.captureException(b,{extra:{context:"Unhandled Promise error detected"}}):a.captureMessage("Unhandled Promise error detected",{extra:{reason:b}})})}}b.exports=d},{}]},{},[1])(1)});
//# sourceMappingURL=ember.min.js.map

@@ -1,2 +0,2 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */

@@ -3,0 +3,0 @@ /*

@@ -1,3 +0,3 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b=b.Raven||(b.Raven={}),b=b.Plugins||(b.Plugins={}),b.Require=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(b,c,d){"use strict";function e(c){"function"==typeof a&&a.amd&&(window.define=c.wrap({deep:!1},a),window.require=c.wrap({deep:!1},b))}c.exports=e},{}]},{},[1])(1)});
//# sourceMappingURL=require.min.js.map

@@ -1,3 +0,3 @@

/*! Raven.js 3.3.0 (74c6c03) | github.com/getsentry/raven-js */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Raven=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a,b,c,d){return JSON.stringify(a,e(b,d),c)}function e(a,b){var c=[],d=[];return null==b&&(b=function(a,b){return c[0]===b?"[Circular ~]":"[Circular ~."+d.slice(0,c.indexOf(b)).join(".")+"]"}),function(e,f){if(c.length>0){var g=c.indexOf(this);~g?c.splice(g+1):c.push(this),~g?d.splice(g,1/0,e):d.push(e),~c.indexOf(f)&&(f=b.call(this,e,f))}else c.push(f);return null==a?f:a.call(this,e,f)}}c=b.exports=d,c.getSerialize=e},{}],2:[function(a,b,c){"use strict";function d(a){this.name="RavenConfigError",this.message=a}d.prototype=new Error,d.prototype.constructor=d,b.exports=d},{}],3:[function(a,b,c){"use strict";var d=function(a,b,c){var d=a[b],e=a;if(b in a){var f="warn"===b?"warning":b;a[b]=function(){var a=[].slice.call(arguments),b=""+a.join(" "),g={level:f,logger:"console",extra:{arguments:a}};c&&c(b,g),d&&Function.prototype.apply.call(d,e,a)}}};b.exports={wrapMethod:d}},{}],4:[function(a,b,c){"use strict";function d(){return+new Date}function e(){this.a=!("object"!=typeof JSON||!JSON.stringify),this.b="undefined"!=typeof document,this.c=null,this.d=null,this.e=null,this.f=null,this.g=null,this.h={},this.i={logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],crossOrigin:"anonymous",collectWindowErrors:!0,maxMessageLength:0,stackTraceLimit:50},this.j=0,this.k=!1,this.l=Error.stackTraceLimit,this.m=window.console||{},this.n={},this.o=[],this.p=d(),this.q=[],this.r=[],this.s=20,this.t=null,this.u=window.location,this.v=this.u&&this.u.href;for(var a in this.m)this.n[a]=this.m[a]}var f=a(7),g=a(2),h=a(6),i=a(1),j=h.isFunction,k=h.isUndefined,l=h.isError,m=h.isEmptyObject,n=h.hasKey,o=h.joinRegExp,p=h.each,q=h.objectMerge,r=h.truncate,s=h.urlencode,t=h.uuid4,u=h.htmlTreeAsString,v=h.parseUrl,w=h.isString,x=a(3).wrapMethod,y="source protocol user pass host port path".split(" "),z=/^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;e.prototype={VERSION:"3.3.0",debug:!1,TraceKit:f,config:function(a,b){var c=this;if(this.e)return this.w("error","Error: Raven has already been configured"),this;if(!a)return this;b&&p(b,function(a,b){"tags"===a||"extra"===a?c.h[a]=b:c.i[a]=b});var d=this.x(a),e=d.path.lastIndexOf("/"),g=d.path.substr(1,e);return this.y=a,this.i.ignoreErrors.push(/^Script error\.?$/),this.i.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/),this.i.ignoreErrors=o(this.i.ignoreErrors),this.i.ignoreUrls=this.i.ignoreUrls.length?o(this.i.ignoreUrls):!1,this.i.whitelistUrls=this.i.whitelistUrls.length?o(this.i.whitelistUrls):!1,this.i.includePaths=o(this.i.includePaths),this.f=d.user,this.z=d.pass&&d.pass.substr(1),this.g=d.path.substr(e+1),this.e=this.A(d),this.B=this.e+"/"+g+"api/"+this.g+"/store/",f.collectWindowErrors=!!this.i.collectWindowErrors,this},install:function(){var a=this;return this.isSetup()&&!this.k&&(f.report.subscribe(function(){a.C.apply(a,arguments)}),this.D(),this.E(),this.k=!0),Error.stackTraceLimit=this.i.stackTraceLimit,this},context:function(a,b,c){return j(a)&&(c=b||[],b=a,a=void 0),this.wrap(a,b).apply(this,c)},wrap:function(a,b,c){function d(){var d=[],f=arguments.length,g=!a||a&&a.deep!==!1;for(c&&j(c)&&c.apply(this,arguments);f--;)d[f]=g?e.wrap(a,arguments[f]):arguments[f];try{return b.apply(this,d)}catch(h){throw e.F(),e.captureException(h,a),h}}var e=this;if(k(b)&&!j(a))return a;if(j(a)&&(b=a,a=void 0),!j(b))return b;try{if(b.G)return b}catch(f){return b}if(b.H)return b.H;for(var g in b)n(b,g)&&(d[g]=b[g]);return d.prototype=b.prototype,b.H=d,d.G=!0,d.I=b,d},uninstall:function(){return f.report.uninstall(),this.J(),Error.stackTraceLimit=this.l,this.k=!1,this},captureException:function(a,b){if(!l(a))return this.captureMessage(a,b);this.c=a;try{var c=f.computeStackTrace(a);this.K(c,b)}catch(d){if(a!==d)throw d}return this},captureMessage:function(a,b){return this.i.ignoreErrors.test&&this.i.ignoreErrors.test(a)?void 0:(this.L(q({message:a+""},b)),this)},captureBreadcrumb:function(a){var b=q({timestamp:d()/1e3},a);this.r.push(b),this.r.length>this.s&&this.r.shift()},addPlugin:function(a){var b=Array.prototype.slice.call(arguments,1);return this.o.push([a,b]),this.k&&this.E(),this},setUserContext:function(a){return this.h.user=a,this},setExtraContext:function(a){return this.M("extra",a),this},setTagsContext:function(a){return this.M("tags",a),this},clearContext:function(){return this.h={},this},getContext:function(){return JSON.parse(i(this.h))},setEnvironment:function(a){return this.i.environment=a,this},setRelease:function(a){return this.i.release=a,this},setDataCallback:function(a){var b=this.i.dataCallback;return this.i.dataCallback=j(a)?function(c){return a(c,b)}:a,this},setShouldSendCallback:function(a){var b=this.i.shouldSendCallback;return this.i.shouldSendCallback=j(a)?function(c){return a(c,b)}:a,this},setTransport:function(a){return this.i.transport=a,this},lastException:function(){return this.c},lastEventId:function(){return this.d},isSetup:function(){return this.a?this.e?!0:(this.ravenNotConfiguredError||(this.ravenNotConfiguredError=!0,this.w("error","Error: Raven has not been configured.")),!1):!1},afterLoad:function(){var a=window.RavenConfig;a&&this.config(a.dsn,a.config).install()},showReportDialog:function(a){if(window.document){a=a||{};var b=a.eventId||this.lastEventId();if(!b)throw new g("Missing eventId");var c=a.dsn||this.y;if(!c)throw new g("Missing DSN");var d=encodeURIComponent,e="";e+="?eventId="+d(b),e+="&dsn="+d(c);var f=a.user||this.h.user;f&&(f.name&&(e+="&name="+d(f.name)),f.email&&(e+="&email="+d(f.email)));var h=this.A(this.x(c)),i=document.createElement("script");i.async=!0,i.src=h+"/api/embed/error-page/"+e,(document.head||document.body).appendChild(i)}},F:function(){var a=this;this.j+=1,setTimeout(function(){a.j-=1})},N:function(a,b){var c,d;if(this.b){b=b||{},a="raven"+a.substr(0,1).toUpperCase()+a.substr(1),document.createEvent?(c=document.createEvent("HTMLEvents"),c.initEvent(a,!0,!0)):(c=document.createEventObject(),c.eventType=a);for(d in b)n(b,d)&&(c[d]=b[d]);if(document.createEvent)document.dispatchEvent(c);else try{document.fireEvent("on"+c.eventType.toLowerCase(),c)}catch(e){}}},O:function(a){var b=this;return function(c){if(b.P=null,b.t!==c){b.t=c;var d,e=c.target;try{d=u(e)}catch(f){d="<unknown>"}b.captureBreadcrumb({category:"ui."+a,message:d})}}},Q:function(){var a=this,b=1e3;return function(c){var d=c.target,e=d&&d.tagName;if(e&&("INPUT"===e||"TEXTAREA"===e)){var f=a.P;f||a.O("input")(c),clearTimeout(f),a.P=setTimeout(function(){a.P=null},b)}}},R:function(a,b){var c=v(this.u.href),d=v(b),e=v(a);this.v=b,c.protocol===d.protocol&&c.host===d.host&&(b=d.relative),c.protocol===e.protocol&&c.host===e.host&&(a=e.relative),this.captureBreadcrumb({category:"navigation",data:{to:b,from:a}})},D:function(){function a(a,b,c,d){var f=a[b];a[b]=c(f),d||e.q.push([a,b,f])}function b(a){return function(b,c){for(var d=new Array(arguments.length),f=0;d.length>f;++f)d[f]=arguments[f];var g=d[0];return j(g)&&(d[0]=e.wrap(g)),a.apply?a.apply(this,d):a(d[0],d[1])}}function c(b){var c=window[b]&&window[b].prototype;c&&c.hasOwnProperty&&c.hasOwnProperty("addEventListener")&&(a(c,"addEventListener",function(a){return function(c,d,f,g){try{d&&d.handleEvent&&(d.handleEvent=e.wrap(d.handleEvent))}catch(h){}var i;return("EventTarget"===b||"Node"===b)&&("click"===c?i=e.O(c):"keypress"===c&&(i=e.Q())),a.call(this,c,e.wrap(d,void 0,i),f,g)}}),a(c,"removeEventListener",function(a){return function(b,c,d,e){return c=c&&(c.H?c.H:c),a.call(this,b,c,d,e)}}))}function d(b,c){b in c&&j(c[b])&&a(c,b,function(a){return e.wrap(a)},!0)}var e=this;a(window,"setTimeout",b),a(window,"setInterval",b),window.requestAnimationFrame&&a(window,"requestAnimationFrame",function(a){return function(b){return a(e.wrap(b))}}),this.b&&(document.addEventListener?(document.addEventListener("click",e.O("click"),!1),document.addEventListener("keypress",e.Q(),!1)):(document.attachEvent("onclick",e.O("click")),document.attachEvent("onkeypress",e.Q())));for(var f=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],g=0;f.length>g;g++)c(f[g]);if("XMLHttpRequest"in window){var h=XMLHttpRequest.prototype;a(h,"open",function(a){return function(b,c){return w(c)&&-1===c.indexOf(e.f)&&(this.S={method:b,url:c,status_code:null}),a.apply(this,arguments)}}),a(h,"send",function(b){return function(c){function f(){if(g.S&&(1===g.readyState||4===g.readyState)){try{g.S.status_code=g.status}catch(a){}e.captureBreadcrumb({type:"http",category:"xhr",data:g.S})}}for(var g=this,h=["onload","onerror","onprogress"],i=0;h.length>i;i++)d(h[i],g);return"onreadystatechange"in g&&j(g.onreadystatechange)?a(g,"onreadystatechange",function(a){return e.wrap(a,void 0,f)},!0):g.onreadystatechange=f,b.apply(this,arguments)}})}var i=window.chrome,k=i&&i.app&&i.app.runtime,l=!k&&window.history&&history.pushState;if(l){var m=window.onpopstate;window.onpopstate=function(){var a=e.u.href;return e.R(e.v,a),m?m.apply(this,arguments):void 0},a(history,"pushState",function(a){return function(){var b=arguments.length>2?arguments[2]:void 0;return b&&e.R(e.v,b+""),a.apply(this,arguments)}})}var n=function(a,b){e.captureBreadcrumb({message:a,level:b.level,category:"console"})};"console"in window&&console.log&&p(["debug","info","warn","error","log"],function(a,b){x(console,b,n)});var o=window.jQuery||window.$;o&&o.fn&&o.fn.ready&&a(o.fn,"ready",function(a){return function(b){return a.call(this,e.wrap(b))}})},J:function(){for(var a;this.q.length;){a=this.q.shift();var b=a[0],c=a[1],d=a[2];b[c]=d}},E:function(){var a=this;p(this.o,function(b,c){var d=c[0],e=c[1];d.apply(a,[a].concat(e))})},x:function(a){var b=z.exec(a),c={},d=7;try{for(;d--;)c[y[d]]=b[d]||""}catch(e){throw new g("Invalid DSN: "+a)}if(c.pass&&!this.i.allowSecretKey)throw new g("Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key");return c},A:function(a){var b="//"+a.host+(a.port?":"+a.port:"");return a.protocol&&(b=a.protocol+":"+b),b},C:function(){this.j||this.K.apply(this,arguments)},K:function(a,b){var c=this,d=[];a.stack&&a.stack.length&&p(a.stack,function(a,b){var e=c.T(b);e&&d.push(e)}),this.N("handle",{stackInfo:a,options:b}),this.U(a.name,a.message,a.url,a.lineno,d.slice(0,this.i.stackTraceLimit),b)},T:function(a){if(a.url){var b={filename:a.url,lineno:a.line,colno:a.column,"function":a.func||"?"};return b.in_app=!(this.i.includePaths.test&&!this.i.includePaths.test(b.filename)||/(Raven|TraceKit)\./.test(b["function"])||/raven\.(min\.)?js$/.test(b.filename)),b}},U:function(a,b,c,d,e,f){var g;if((!this.i.ignoreErrors.test||!this.i.ignoreErrors.test(b))&&(b+="",e&&e.length?(c=e[0].filename||c,e.reverse(),g={frames:e}):c&&(g={frames:[{filename:c,lineno:d,in_app:!0}]}),(!this.i.ignoreUrls.test||!this.i.ignoreUrls.test(c))&&(!this.i.whitelistUrls.test||this.i.whitelistUrls.test(c)))){var h=q({exception:{values:[{type:a,value:b,stacktrace:g}]},culprit:c},f);this.L(h)}},V:function(a){var b=this.i.maxMessageLength;if(a.message&&(a.message=r(a.message,b)),a.exception){var c=a.exception.values[0];c.value=r(c.value,b)}return a},W:function(){if(this.b&&document.location&&document.location.href){var a={headers:{"User-Agent":navigator.userAgent}};return a.url=document.location.href,document.referrer&&(a.headers.Referer=document.referrer),a}},L:function(a){var b=this,c=this.i,e={project:this.g,logger:c.logger,platform:"javascript"},f=this.W();if(f&&(e.request=f),a=q(e,a),a.tags=q(q({},this.h.tags),a.tags),a.extra=q(q({},this.h.extra),a.extra),a.extra["session:duration"]=d()-this.p,this.r&&this.r.length>0&&(a.breadcrumbs={values:[].slice.call(this.r,0)}),m(a.tags)&&delete a.tags,this.h.user&&(a.user=this.h.user),c.environment&&(a.environment=c.environment),c.release&&(a.release=c.release),c.serverName&&(a.server_name=c.serverName),j(c.dataCallback)&&(a=c.dataCallback(a)||a),a&&!m(a)&&(!j(c.shouldSendCallback)||c.shouldSendCallback(a))&&(this.d=a.event_id||(a.event_id=t()),a=this.V(a),this.w("debug","Raven about to send:",a),this.isSetup())){var g={sentry_version:"7",sentry_client:"raven-js/"+this.VERSION,sentry_key:this.f};this.z&&(g.sentry_secret=this.z);var h=a.exception&&a.exception.values[0];this.captureBreadcrumb({category:"sentry",message:h?(h.type?h.type+": ":"")+h.message:a.message,event_id:a.event_id,level:a.level||"error"});var i=this.B;(c.transport||this.X).call(this,{url:i,auth:g,data:a,options:c,onSuccess:function(){b.N("success",{data:a,src:i})},onError:function(){b.N("failure",{data:a,src:i})}})}},X:function(a){function b(){200===c.status?a.onSuccess&&a.onSuccess():a.onError&&a.onError()}var c=new XMLHttpRequest,d="withCredentials"in c||"undefined"!=typeof XDomainRequest;if(d){var e=a.url;"withCredentials"in c?c.onreadystatechange=function(){4===c.readyState&&b()}:(c=new XDomainRequest,e=e.replace(/^https?:/,""),c.onload=b),c.open("POST",e+"?"+s(a.auth)),c.send(i(a.data))}},w:function(a){this.n[a]&&this.debug&&Function.prototype.apply.call(this.n[a],this.m,[].slice.call(arguments,1))},M:function(a,b){k(b)?delete this.h[a]:this.h[a]=q(this.h[a]||{},b)}},e.prototype.setUser=e.prototype.setUserContext,e.prototype.setReleaseContext=e.prototype.setRelease,b.exports=e},{1:1,2:2,3:3,6:6,7:7}],5:[function(a,b,c){"use strict";var d=a(4),e=window.Raven,f=new d;f.noConflict=function(){return window.Raven=e,f},f.afterLoad(),b.exports=f},{4:4}],6:[function(a,b,c){"use strict";function d(a){return void 0===a}function e(a){return"function"==typeof a}function f(a){return"[object String]"===t.toString.call(a)}function g(a){return"object"==typeof a&&null!==a}function h(a){for(var b in a)return!1;return!0}function i(a){var b=t.toString.call(a);return g(a)&&"[object Error]"===b||"[object Exception]"===b||a instanceof Error}function j(a,b){var c,e;if(d(a.length))for(c in a)m(a,c)&&b.call(null,c,a[c]);else if(e=a.length)for(c=0;e>c;c++)b.call(null,c,a[c])}function k(a,b){return b?(j(b,function(b,c){a[b]=c}),a):a}function l(a,b){return!b||b>=a.length?a:a.substr(0,b)+"…"}function m(a,b){return t.hasOwnProperty.call(a,b)}function n(a){for(var b,c=[],d=0,e=a.length;e>d;d++)b=a[d],f(b)?c.push(b.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):b&&b.source&&c.push(b.source);return new RegExp(c.join("|"),"i")}function o(a){var b=[];return j(a,function(a,c){b.push(encodeURIComponent(a)+"="+encodeURIComponent(c))}),b.join("&")}function p(a){var b=a.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!b)return{};var c=b[6]||"",d=b[8]||"";return{protocol:b[2],host:b[4],path:b[5],relative:b[5]+c+d}}function q(){var a=window.crypto||window.msCrypto;if(!d(a)&&a.getRandomValues){var b=new Uint16Array(8);a.getRandomValues(b),b[3]=4095&b[3]|16384,b[4]=16383&b[4]|32768;var c=function(a){for(var b=a.toString(16);4>b.length;)b="0"+b;return b};return c(b[0])+c(b[1])+c(b[2])+c(b[3])+c(b[4])+c(b[5])+c(b[6])+c(b[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)})}function r(a){for(var b,c=5,d=80,e=[],f=0,g=0,h=" > ",i=h.length;a&&f++<c&&(b=s(a),!("html"===b||f>1&&g+e.length*i+b.length>=d));)e.push(b),g+=b.length,a=a.parentNode;return e.reverse().join(h)}function s(a){var b,c,d,e,g,h=[];if(!a||!a.tagName)return"";if(h.push(a.tagName.toLowerCase()),a.id&&h.push("#"+a.id),b=a.className,b&&f(b))for(c=b.split(" "),g=0;c.length>g;g++)h.push("."+c[g]);var i=["type","name","title","alt"];for(g=0;i.length>g;g++)d=i[g],e=a.getAttribute(d),e&&h.push("["+d+'="'+e+'"]');return h.join("")}var t=Object.prototype;b.exports={isUndefined:d,isFunction:e,isString:f,isObject:g,isEmptyObject:h,isError:i,each:j,objectMerge:k,truncate:l,hasKey:m,joinRegExp:n,urlencode:o,uuid4:q,htmlTreeAsString:r,htmlElementAsString:s,parseUrl:p}},{}],7:[function(a,b,c){"use strict";function d(){return"undefined"==typeof document?"":document.location.href}var e=a(6),f=e.hasKey,g=e.isString,h=e.isUndefined,i={collectWindowErrors:!0,debug:!1},j=[].slice,k="?",l=/^(?:Uncaught (?:exception: )?)?((?:Eval|Internal|Range|Reference|Syntax|Type|URI)Error): ?(.*)$/;i.report=function(){function a(a){m(),s.push(a)}function b(a){for(var b=s.length-1;b>=0;--b)s[b]===a&&s.splice(b,1)}function c(){n(),s=[]}function e(a,b){var c=null;if(!b||i.collectWindowErrors){for(var d in s)if(f(s,d))try{s[d].apply(null,[a].concat(j.call(arguments,2)))}catch(e){c=e}if(c)throw c}}function h(a,b,c,f,h){var j=null;if(v)i.computeStackTrace.augmentStackTraceWithInitialElement(v,b,c,a),o();else if(h)j=i.computeStackTrace(h),e(j,!0);else{var m,n={url:b,line:c,column:f},p=void 0,r=a;if(g(a)){var m=a.match(l);m&&(p=m[1],r=m[2])}n.func=k,j={name:p,message:r,url:d(),stack:[n]},e(j,!0)}return q?q.apply(this,arguments):!1}function m(){r||(q=window.onerror,window.onerror=h,r=!0)}function n(){r&&(window.onerror=q,r=!1,q=void 0)}function o(){var a=v,b=t;t=null,v=null,u=null,e.apply(null,[a,!1].concat(b))}function p(a,b){var c=j.call(arguments,1);if(v){if(u===a)return;o()}var d=i.computeStackTrace(a);if(v=d,u=a,t=c,window.setTimeout(function(){u===a&&o()},d.incomplete?2e3:0),b!==!1)throw a}var q,r,s=[],t=null,u=null,v=null;return p.subscribe=a,p.unsubscribe=b,p.uninstall=c,p}(),i.computeStackTrace=function(){function a(a){if(!h(a.stack)&&a.stack){for(var b,c,e=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|<anonymous>).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,f=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,g=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=a.stack.split("\n"),j=[],l=(/^(.*) is undefined$/.exec(a.message),0),m=i.length;m>l;++l){if(b=e.exec(i[l])){var n=b[2]&&-1!==b[2].indexOf("native");c={url:n?null:b[2],func:b[1]||k,args:n?[b[2]]:[],line:b[3]?+b[3]:null,column:b[4]?+b[4]:null}}else if(b=g.exec(i[l]))c={url:b[2],func:b[1]||k,args:[],line:+b[3],column:b[4]?+b[4]:null};else{if(!(b=f.exec(i[l])))continue;c={url:b[3],func:b[1]||k,args:b[2]?b[2].split(","):[],line:b[4]?+b[4]:null,column:b[5]?+b[5]:null}}!c.func&&c.line&&(c.func=k),j.push(c)}return j.length?(j[0].column||h(a.columnNumber)||(j[0].column=a.columnNumber+1),{name:a.name,message:a.message,url:d(),stack:j}):null}}function b(a){var b=a.stacktrace;if(!h(a.stacktrace)&&a.stacktrace){for(var c,e=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,f=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,g=b.split("\n"),i=[],j=0;g.length>j;j+=2){var l=null;(c=e.exec(g[j]))?l={url:c[2],line:+c[1],column:null,func:c[3],args:[]}:(c=f.exec(g[j]))&&(l={url:c[6],line:+c[1],column:+c[2],func:c[3]||c[4],args:c[5]?c[5].split(","):[]}),l&&(!l.func&&l.line&&(l.func=k),i.push(l))}return i.length?{name:a.name,message:a.message,url:d(),stack:i}:null}}function c(a){var b=a.message.split("\n");if(4>b.length)return null;for(var c,e=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,f=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,g=/^\s*Line (\d+) of function script\s*$/i,h=[],i=(document.getElementsByTagName("script"),2);b.length>i;i+=2){var j=null;if(c=e.exec(b[i]))j={url:c[2],func:c[3],args:[],line:+c[1],column:null};else if(c=f.exec(b[i])){j={url:c[3],func:c[4],args:[],line:+c[1],column:null}}else if(c=g.exec(b[i])){var l=window.location.href.replace(/#.*$/,"");j={url:l,func:"",args:[],line:c[1],column:null}}j&&(j.func||(j.func=k),h.push(j))}return h.length?{name:a.name,message:b[0],url:d(),stack:h}:null}function e(a,b,c,d){var e={url:b,line:c};if(e.url&&e.line){if(a.incomplete=!1,e.func||(e.func=k),a.stack.length>0&&a.stack[0].url===e.url){if(a.stack[0].line===e.line)return!1;if(!a.stack[0].line&&a.stack[0].func===e.func)return a.stack[0].line=e.line,!1}return a.stack.unshift(e),a.partial=!0,!0}return a.incomplete=!0,!1}function f(a,b){for(var c,h,j=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,l=[],m={},n=!1,o=f.caller;o&&!n;o=o.caller)if(o!==g&&o!==i.report){if(h={url:null,func:k,line:null,column:null},o.name?h.func=o.name:(c=j.exec(o.toString()))&&(h.func=c[1]),"undefined"==typeof h.func)try{h.func=c.input.substring(0,c.input.indexOf("{"))}catch(p){}m[""+o]?n=!0:m[""+o]=!0,l.push(h)}b&&l.splice(0,b);var q={name:a.name,message:a.message,url:d(),stack:l};return e(q,a.sourceURL||a.fileName,a.line||a.lineNumber,a.message||a.description),q}function g(e,g){var h=null;g=null==g?0:+g;try{if(h=b(e))return h}catch(j){if(i.debug)throw j}try{if(h=a(e))return h}catch(j){if(i.debug)throw j}try{if(h=c(e))return h}catch(j){if(i.debug)throw j}try{if(h=f(e,g+1))return h}catch(j){if(i.debug)throw j}return{name:e.name,message:e.message,url:d()}}return g.augmentStackTraceWithInitialElement=e,g.computeStackTraceFromStackProp=a,g}(),b.exports=i},{6:6}]},{},[5])(5)});
/*! Raven.js 3.4.0 (4dba6fe) | github.com/getsentry/raven-js */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Raven=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a,b,c,d){return JSON.stringify(a,e(b,d),c)}function e(a,b){var c=[],d=[];return null==b&&(b=function(a,b){return c[0]===b?"[Circular ~]":"[Circular ~."+d.slice(0,c.indexOf(b)).join(".")+"]"}),function(e,f){if(c.length>0){var g=c.indexOf(this);~g?c.splice(g+1):c.push(this),~g?d.splice(g,1/0,e):d.push(e),~c.indexOf(f)&&(f=b.call(this,e,f))}else c.push(f);return null==a?f:a.call(this,e,f)}}c=b.exports=d,c.getSerialize=e},{}],2:[function(a,b,c){"use strict";function d(a){this.name="RavenConfigError",this.message=a}d.prototype=new Error,d.prototype.constructor=d,b.exports=d},{}],3:[function(a,b,c){"use strict";var d=function(a,b,c){var d=a[b],e=a;if(b in a){var f="warn"===b?"warning":b;a[b]=function(){var a=[].slice.call(arguments),b=""+a.join(" "),g={level:f,logger:"console",extra:{arguments:a}};c&&c(b,g),d&&Function.prototype.apply.call(d,e,a)}}};b.exports={wrapMethod:d}},{}],4:[function(a,b,c){"use strict";function d(){return+new Date}function e(){this.a=!("object"!=typeof JSON||!JSON.stringify),this.b="undefined"!=typeof document,this.c=null,this.d=null,this.e=null,this.f=null,this.g=null,this.h={},this.i={logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],crossOrigin:"anonymous",collectWindowErrors:!0,maxMessageLength:0,stackTraceLimit:50},this.j=0,this.k=!1,this.l=Error.stackTraceLimit,this.m=window.console||{},this.n={},this.o=[],this.p=d(),this.q=[],this.r=[],this.s=20,this.t=null,this.u=window.location,this.v=this.u&&this.u.href;for(var a in this.m)this.n[a]=this.m[a]}var f=a(7),g=a(2),h=a(6),i=a(1),j=h.isFunction,k=h.isUndefined,l=h.isError,m=h.isEmptyObject,n=h.hasKey,o=h.joinRegExp,p=h.each,q=h.objectMerge,r=h.truncate,s=h.urlencode,t=h.uuid4,u=h.htmlTreeAsString,v=h.parseUrl,w=h.isString,x=a(3).wrapMethod,y="source protocol user pass host port path".split(" "),z=/^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;e.prototype={VERSION:"3.4.0",debug:!1,TraceKit:f,config:function(a,b){var c=this;if(this.e)return this.w("error","Error: Raven has already been configured"),this;if(!a)return this;b&&p(b,function(a,b){"tags"===a||"extra"===a?c.h[a]=b:c.i[a]=b});var d=this.x(a),e=d.path.lastIndexOf("/"),g=d.path.substr(1,e);return this.y=a,this.i.ignoreErrors.push(/^Script error\.?$/),this.i.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/),this.i.ignoreErrors=o(this.i.ignoreErrors),this.i.ignoreUrls=this.i.ignoreUrls.length?o(this.i.ignoreUrls):!1,this.i.whitelistUrls=this.i.whitelistUrls.length?o(this.i.whitelistUrls):!1,this.i.includePaths=o(this.i.includePaths),this.f=d.user,this.z=d.pass&&d.pass.substr(1),this.g=d.path.substr(e+1),this.e=this.A(d),this.B=this.e+"/"+g+"api/"+this.g+"/store/",f.collectWindowErrors=!!this.i.collectWindowErrors,this},install:function(){var a=this;return this.isSetup()&&!this.k&&(f.report.subscribe(function(){a.C.apply(a,arguments)}),this.D(),this.E(),this.k=!0),Error.stackTraceLimit=this.i.stackTraceLimit,this},context:function(a,b,c){return j(a)&&(c=b||[],b=a,a=void 0),this.wrap(a,b).apply(this,c)},wrap:function(a,b,c){function d(){var d=[],f=arguments.length,g=!a||a&&a.deep!==!1;for(c&&j(c)&&c.apply(this,arguments);f--;)d[f]=g?e.wrap(a,arguments[f]):arguments[f];try{return b.apply(this,d)}catch(h){throw e.F(),e.captureException(h,a),h}}var e=this;if(k(b)&&!j(a))return a;if(j(a)&&(b=a,a=void 0),!j(b))return b;try{if(b.G)return b}catch(f){return b}if(b.H)return b.H;for(var g in b)n(b,g)&&(d[g]=b[g]);return d.prototype=b.prototype,b.H=d,d.G=!0,d.I=b,d},uninstall:function(){return f.report.uninstall(),this.J(),Error.stackTraceLimit=this.l,this.k=!1,this},captureException:function(a,b){if(!l(a))return this.captureMessage(a,b);this.c=a;try{var c=f.computeStackTrace(a);this.K(c,b)}catch(d){if(a!==d)throw d}return this},captureMessage:function(a,b){return this.i.ignoreErrors.test&&this.i.ignoreErrors.test(a)?void 0:(this.L(q({message:a+""},b)),this)},captureBreadcrumb:function(a){var b=q({timestamp:d()/1e3},a);this.r.push(b),this.r.length>this.s&&this.r.shift()},addPlugin:function(a){var b=Array.prototype.slice.call(arguments,1);return this.o.push([a,b]),this.k&&this.E(),this},setUserContext:function(a){return this.h.user=a,this},setExtraContext:function(a){return this.M("extra",a),this},setTagsContext:function(a){return this.M("tags",a),this},clearContext:function(){return this.h={},this},getContext:function(){return JSON.parse(i(this.h))},setEnvironment:function(a){return this.i.environment=a,this},setRelease:function(a){return this.i.release=a,this},setDataCallback:function(a){var b=this.i.dataCallback;return this.i.dataCallback=j(a)?function(c){return a(c,b)}:a,this},setShouldSendCallback:function(a){var b=this.i.shouldSendCallback;return this.i.shouldSendCallback=j(a)?function(c){return a(c,b)}:a,this},setTransport:function(a){return this.i.transport=a,this},lastException:function(){return this.c},lastEventId:function(){return this.d},isSetup:function(){return this.a?this.e?!0:(this.ravenNotConfiguredError||(this.ravenNotConfiguredError=!0,this.w("error","Error: Raven has not been configured.")),!1):!1},afterLoad:function(){var a=window.RavenConfig;a&&this.config(a.dsn,a.config).install()},showReportDialog:function(a){if(window.document){a=a||{};var b=a.eventId||this.lastEventId();if(!b)throw new g("Missing eventId");var c=a.dsn||this.y;if(!c)throw new g("Missing DSN");var d=encodeURIComponent,e="";e+="?eventId="+d(b),e+="&dsn="+d(c);var f=a.user||this.h.user;f&&(f.name&&(e+="&name="+d(f.name)),f.email&&(e+="&email="+d(f.email)));var h=this.A(this.x(c)),i=document.createElement("script");i.async=!0,i.src=h+"/api/embed/error-page/"+e,(document.head||document.body).appendChild(i)}},F:function(){var a=this;this.j+=1,setTimeout(function(){a.j-=1})},N:function(a,b){var c,d;if(this.b){b=b||{},a="raven"+a.substr(0,1).toUpperCase()+a.substr(1),document.createEvent?(c=document.createEvent("HTMLEvents"),c.initEvent(a,!0,!0)):(c=document.createEventObject(),c.eventType=a);for(d in b)n(b,d)&&(c[d]=b[d]);if(document.createEvent)document.dispatchEvent(c);else try{document.fireEvent("on"+c.eventType.toLowerCase(),c)}catch(e){}}},O:function(a){var b=this;return function(c){if(b.P=null,b.t!==c){b.t=c;var d,e=c.target;try{d=u(e)}catch(f){d="<unknown>"}b.captureBreadcrumb({category:"ui."+a,message:d})}}},Q:function(){var a=this,b=1e3;return function(c){var d=c.target,e=d&&d.tagName;if(e&&("INPUT"===e||"TEXTAREA"===e)){var f=a.P;f||a.O("input")(c),clearTimeout(f),a.P=setTimeout(function(){a.P=null},b)}}},R:function(a,b){var c=v(this.u.href),d=v(b),e=v(a);this.v=b,c.protocol===d.protocol&&c.host===d.host&&(b=d.relative),c.protocol===e.protocol&&c.host===e.host&&(a=e.relative),this.captureBreadcrumb({category:"navigation",data:{to:b,from:a}})},D:function(){function a(a,b,c,d){var f=a[b];a[b]=c(f),d||e.q.push([a,b,f])}function b(a){return function(b,c){for(var d=new Array(arguments.length),f=0;d.length>f;++f)d[f]=arguments[f];var g=d[0];return j(g)&&(d[0]=e.wrap(g)),a.apply?a.apply(this,d):a(d[0],d[1])}}function c(b){var c=window[b]&&window[b].prototype;c&&c.hasOwnProperty&&c.hasOwnProperty("addEventListener")&&(a(c,"addEventListener",function(a){return function(c,d,f,g){try{d&&d.handleEvent&&(d.handleEvent=e.wrap(d.handleEvent))}catch(h){}var i;return("EventTarget"===b||"Node"===b)&&("click"===c?i=e.O(c):"keypress"===c&&(i=e.Q())),a.call(this,c,e.wrap(d,void 0,i),f,g)}}),a(c,"removeEventListener",function(a){return function(b,c,d,e){return c=c&&(c.H?c.H:c),a.call(this,b,c,d,e)}}))}function d(b,c){b in c&&j(c[b])&&a(c,b,function(a){return e.wrap(a)},!0)}var e=this;a(window,"setTimeout",b),a(window,"setInterval",b),window.requestAnimationFrame&&a(window,"requestAnimationFrame",function(a){return function(b){return a(e.wrap(b))}}),this.b&&(document.addEventListener?(document.addEventListener("click",e.O("click"),!1),document.addEventListener("keypress",e.Q(),!1)):(document.attachEvent("onclick",e.O("click")),document.attachEvent("onkeypress",e.Q())));for(var f=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],g=0;f.length>g;g++)c(f[g]);if("XMLHttpRequest"in window){var h=XMLHttpRequest.prototype;a(h,"open",function(a){return function(b,c){return w(c)&&-1===c.indexOf(e.f)&&(this.S={method:b,url:c,status_code:null}),a.apply(this,arguments)}}),a(h,"send",function(b){return function(c){function f(){if(g.S&&(1===g.readyState||4===g.readyState)){try{g.S.status_code=g.status}catch(a){}e.captureBreadcrumb({type:"http",category:"xhr",data:g.S})}}for(var g=this,h=["onload","onerror","onprogress"],i=0;h.length>i;i++)d(h[i],g);return"onreadystatechange"in g&&j(g.onreadystatechange)?a(g,"onreadystatechange",function(a){return e.wrap(a,void 0,f)},!0):g.onreadystatechange=f,b.apply(this,arguments)}})}var i=window.chrome,k=i&&i.app&&i.app.runtime,l=!k&&window.history&&history.pushState;if(l){var m=window.onpopstate;window.onpopstate=function(){var a=e.u.href;return e.R(e.v,a),m?m.apply(this,arguments):void 0},a(history,"pushState",function(a){return function(){var b=arguments.length>2?arguments[2]:void 0;return b&&e.R(e.v,b+""),a.apply(this,arguments)}})}var n=function(a,b){e.captureBreadcrumb({message:a,level:b.level,category:"console"})};"console"in window&&console.log&&p(["debug","info","warn","error","log"],function(a,b){x(console,b,n)});var o=window.jQuery||window.$;o&&o.fn&&o.fn.ready&&a(o.fn,"ready",function(a){return function(b){return a.call(this,e.wrap(b))}})},J:function(){for(var a;this.q.length;){a=this.q.shift();var b=a[0],c=a[1],d=a[2];b[c]=d}},E:function(){var a=this;p(this.o,function(b,c){var d=c[0],e=c[1];d.apply(a,[a].concat(e))})},x:function(a){var b=z.exec(a),c={},d=7;try{for(;d--;)c[y[d]]=b[d]||""}catch(e){throw new g("Invalid DSN: "+a)}if(c.pass&&!this.i.allowSecretKey)throw new g("Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key");return c},A:function(a){var b="//"+a.host+(a.port?":"+a.port:"");return a.protocol&&(b=a.protocol+":"+b),b},C:function(){this.j||this.K.apply(this,arguments)},K:function(a,b){var c=this,d=[];a.stack&&a.stack.length&&p(a.stack,function(a,b){var e=c.T(b);e&&d.push(e)}),this.N("handle",{stackInfo:a,options:b}),this.U(a.name,a.message,a.url,a.lineno,d.slice(0,this.i.stackTraceLimit),b)},T:function(a){if(a.url){var b={filename:a.url,lineno:a.line,colno:a.column,"function":a.func||"?"};return b.in_app=!(this.i.includePaths.test&&!this.i.includePaths.test(b.filename)||/(Raven|TraceKit)\./.test(b["function"])||/raven\.(min\.)?js$/.test(b.filename)),b}},U:function(a,b,c,d,e,f){var g;if((!this.i.ignoreErrors.test||!this.i.ignoreErrors.test(b))&&(b+="",e&&e.length?(c=e[0].filename||c,e.reverse(),g={frames:e}):c&&(g={frames:[{filename:c,lineno:d,in_app:!0}]}),(!this.i.ignoreUrls.test||!this.i.ignoreUrls.test(c))&&(!this.i.whitelistUrls.test||this.i.whitelistUrls.test(c)))){var h=q({exception:{values:[{type:a,value:b,stacktrace:g}]},culprit:c},f);this.L(h)}},V:function(a){var b=this.i.maxMessageLength;if(a.message&&(a.message=r(a.message,b)),a.exception){var c=a.exception.values[0];c.value=r(c.value,b)}return a},W:function(){if(this.b&&document.location&&document.location.href){var a={headers:{"User-Agent":navigator.userAgent}};return a.url=document.location.href,document.referrer&&(a.headers.Referer=document.referrer),a}},L:function(a){var b=this.i,c={project:this.g,logger:b.logger,platform:"javascript"},e=this.W();e&&(c.request=e),a=q(c,a),a.tags=q(q({},this.h.tags),a.tags),a.extra=q(q({},this.h.extra),a.extra),a.extra["session:duration"]=d()-this.p,this.r&&this.r.length>0&&(a.breadcrumbs={values:[].slice.call(this.r,0)}),m(a.tags)&&delete a.tags,this.h.user&&(a.user=this.h.user),b.environment&&(a.environment=b.environment),b.release&&(a.release=b.release),b.serverName&&(a.server_name=b.serverName),j(b.dataCallback)&&(a=b.dataCallback(a)||a),a&&!m(a)&&(!j(b.shouldSendCallback)||b.shouldSendCallback(a))&&this.X(a)},X:function(a,b){var c=this,d=this.i;if(this.d=a.event_id||(a.event_id=t()),a=this.V(a),this.w("debug","Raven about to send:",a),this.isSetup()){var e={sentry_version:"7",sentry_client:"raven-js/"+this.VERSION,sentry_key:this.f};this.z&&(e.sentry_secret=this.z);var f=a.exception&&a.exception.values[0];this.captureBreadcrumb({category:"sentry",message:f?(f.type?f.type+": ":"")+f.message:a.message,event_id:a.event_id,level:a.level||"error"});var g=this.B;(d.transport||this.Y).call(this,{url:g,auth:e,data:a,options:d,onSuccess:function(){c.N("success",{data:a,src:g}),b&&b()},onError:function(d){c.N("failure",{data:a,src:g}),d=d||new Error("Raven send failed (no additional details provided)"),b&&b(d)}})}},Y:function(a){function b(){200===c.status?a.onSuccess&&a.onSuccess():a.onError&&a.onError(new Error("Sentry error code: "+c.status))}var c=new XMLHttpRequest,d="withCredentials"in c||"undefined"!=typeof XDomainRequest;if(d){var e=a.url;"withCredentials"in c?c.onreadystatechange=function(){4===c.readyState&&b()}:(c=new XDomainRequest,e=e.replace(/^https?:/,""),c.onload=b),c.open("POST",e+"?"+s(a.auth)),c.send(i(a.data))}},w:function(a){this.n[a]&&this.debug&&Function.prototype.apply.call(this.n[a],this.m,[].slice.call(arguments,1))},M:function(a,b){k(b)?delete this.h[a]:this.h[a]=q(this.h[a]||{},b)}},e.prototype.setUser=e.prototype.setUserContext,e.prototype.setReleaseContext=e.prototype.setRelease,b.exports=e},{1:1,2:2,3:3,6:6,7:7}],5:[function(a,b,c){"use strict";var d=a(4),e=window.Raven,f=new d;f.noConflict=function(){return window.Raven=e,f},f.afterLoad(),b.exports=f},{4:4}],6:[function(a,b,c){"use strict";function d(a){return void 0===a}function e(a){return"function"==typeof a}function f(a){return"[object String]"===t.toString.call(a)}function g(a){return"object"==typeof a&&null!==a}function h(a){for(var b in a)return!1;return!0}function i(a){var b=t.toString.call(a);return g(a)&&"[object Error]"===b||"[object Exception]"===b||a instanceof Error}function j(a,b){var c,e;if(d(a.length))for(c in a)m(a,c)&&b.call(null,c,a[c]);else if(e=a.length)for(c=0;e>c;c++)b.call(null,c,a[c])}function k(a,b){return b?(j(b,function(b,c){a[b]=c}),a):a}function l(a,b){return!b||b>=a.length?a:a.substr(0,b)+"…"}function m(a,b){return t.hasOwnProperty.call(a,b)}function n(a){for(var b,c=[],d=0,e=a.length;e>d;d++)b=a[d],f(b)?c.push(b.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):b&&b.source&&c.push(b.source);return new RegExp(c.join("|"),"i")}function o(a){var b=[];return j(a,function(a,c){b.push(encodeURIComponent(a)+"="+encodeURIComponent(c))}),b.join("&")}function p(a){var b=a.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!b)return{};var c=b[6]||"",d=b[8]||"";return{protocol:b[2],host:b[4],path:b[5],relative:b[5]+c+d}}function q(){var a=window.crypto||window.msCrypto;if(!d(a)&&a.getRandomValues){var b=new Uint16Array(8);a.getRandomValues(b),b[3]=4095&b[3]|16384,b[4]=16383&b[4]|32768;var c=function(a){for(var b=a.toString(16);4>b.length;)b="0"+b;return b};return c(b[0])+c(b[1])+c(b[2])+c(b[3])+c(b[4])+c(b[5])+c(b[6])+c(b[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)})}function r(a){for(var b,c=5,d=80,e=[],f=0,g=0,h=" > ",i=h.length;a&&f++<c&&(b=s(a),!("html"===b||f>1&&g+e.length*i+b.length>=d));)e.push(b),g+=b.length,a=a.parentNode;return e.reverse().join(h)}function s(a){var b,c,d,e,g,h=[];if(!a||!a.tagName)return"";if(h.push(a.tagName.toLowerCase()),a.id&&h.push("#"+a.id),b=a.className,b&&f(b))for(c=b.split(" "),g=0;c.length>g;g++)h.push("."+c[g]);var i=["type","name","title","alt"];for(g=0;i.length>g;g++)d=i[g],e=a.getAttribute(d),e&&h.push("["+d+'="'+e+'"]');return h.join("")}var t=Object.prototype;b.exports={isUndefined:d,isFunction:e,isString:f,isObject:g,isEmptyObject:h,isError:i,each:j,objectMerge:k,truncate:l,hasKey:m,joinRegExp:n,urlencode:o,uuid4:q,htmlTreeAsString:r,htmlElementAsString:s,parseUrl:p}},{}],7:[function(a,b,c){"use strict";function d(){return"undefined"==typeof document?"":document.location.href}var e=a(6),f=e.hasKey,g=e.isString,h=e.isUndefined,i={collectWindowErrors:!0,debug:!1},j=[].slice,k="?",l=/^(?:Uncaught (?:exception: )?)?((?:Eval|Internal|Range|Reference|Syntax|Type|URI)Error): ?(.*)$/;i.report=function(){function a(a){m(),s.push(a)}function b(a){for(var b=s.length-1;b>=0;--b)s[b]===a&&s.splice(b,1)}function c(){n(),s=[]}function e(a,b){var c=null;if(!b||i.collectWindowErrors){for(var d in s)if(f(s,d))try{s[d].apply(null,[a].concat(j.call(arguments,2)))}catch(e){c=e}if(c)throw c}}function h(a,b,c,f,h){var j=null;if(v)i.computeStackTrace.augmentStackTraceWithInitialElement(v,b,c,a),o();else if(h)j=i.computeStackTrace(h),e(j,!0);else{var m,n={url:b,line:c,column:f},p=void 0,r=a;if(g(a)){var m=a.match(l);m&&(p=m[1],r=m[2])}n.func=k,j={name:p,message:r,url:d(),stack:[n]},e(j,!0)}return q?q.apply(this,arguments):!1}function m(){r||(q=window.onerror,window.onerror=h,r=!0)}function n(){r&&(window.onerror=q,r=!1,q=void 0)}function o(){var a=v,b=t;t=null,v=null,u=null,e.apply(null,[a,!1].concat(b))}function p(a,b){var c=j.call(arguments,1);if(v){if(u===a)return;o()}var d=i.computeStackTrace(a);if(v=d,u=a,t=c,window.setTimeout(function(){u===a&&o()},d.incomplete?2e3:0),b!==!1)throw a}var q,r,s=[],t=null,u=null,v=null;return p.subscribe=a,p.unsubscribe=b,p.uninstall=c,p}(),i.computeStackTrace=function(){function a(a){if(!h(a.stack)&&a.stack){for(var b,c,e=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|<anonymous>).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,f=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,g=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=a.stack.split("\n"),j=[],l=(/^(.*) is undefined$/.exec(a.message),0),m=i.length;m>l;++l){if(b=e.exec(i[l])){var n=b[2]&&-1!==b[2].indexOf("native");c={url:n?null:b[2],func:b[1]||k,args:n?[b[2]]:[],line:b[3]?+b[3]:null,column:b[4]?+b[4]:null}}else if(b=g.exec(i[l]))c={url:b[2],func:b[1]||k,args:[],line:+b[3],column:b[4]?+b[4]:null};else{if(!(b=f.exec(i[l])))continue;c={url:b[3],func:b[1]||k,args:b[2]?b[2].split(","):[],line:b[4]?+b[4]:null,column:b[5]?+b[5]:null}}!c.func&&c.line&&(c.func=k),j.push(c)}return j.length?(j[0].column||h(a.columnNumber)||(j[0].column=a.columnNumber+1),{name:a.name,message:a.message,url:d(),stack:j}):null}}function b(a){var b=a.stacktrace;if(!h(a.stacktrace)&&a.stacktrace){for(var c,e=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,f=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,g=b.split("\n"),i=[],j=0;g.length>j;j+=2){var l=null;(c=e.exec(g[j]))?l={url:c[2],line:+c[1],column:null,func:c[3],args:[]}:(c=f.exec(g[j]))&&(l={url:c[6],line:+c[1],column:+c[2],func:c[3]||c[4],args:c[5]?c[5].split(","):[]}),l&&(!l.func&&l.line&&(l.func=k),i.push(l))}return i.length?{name:a.name,message:a.message,url:d(),stack:i}:null}}function c(a){var b=a.message.split("\n");if(4>b.length)return null;for(var c,e=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,f=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,g=/^\s*Line (\d+) of function script\s*$/i,h=[],i=(document.getElementsByTagName("script"),2);b.length>i;i+=2){var j=null;if(c=e.exec(b[i]))j={url:c[2],func:c[3],args:[],line:+c[1],column:null};else if(c=f.exec(b[i])){j={url:c[3],func:c[4],args:[],line:+c[1],column:null}}else if(c=g.exec(b[i])){var l=window.location.href.replace(/#.*$/,"");j={url:l,func:"",args:[],line:c[1],column:null}}j&&(j.func||(j.func=k),h.push(j))}return h.length?{name:a.name,message:b[0],url:d(),stack:h}:null}function e(a,b,c,d){var e={url:b,line:c};if(e.url&&e.line){if(a.incomplete=!1,e.func||(e.func=k),a.stack.length>0&&a.stack[0].url===e.url){if(a.stack[0].line===e.line)return!1;if(!a.stack[0].line&&a.stack[0].func===e.func)return a.stack[0].line=e.line,!1}return a.stack.unshift(e),a.partial=!0,!0}return a.incomplete=!0,!1}function f(a,b){for(var c,h,j=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,l=[],m={},n=!1,o=f.caller;o&&!n;o=o.caller)if(o!==g&&o!==i.report){if(h={url:null,func:k,line:null,column:null},o.name?h.func=o.name:(c=j.exec(o.toString()))&&(h.func=c[1]),"undefined"==typeof h.func)try{h.func=c.input.substring(0,c.input.indexOf("{"))}catch(p){}m[""+o]?n=!0:m[""+o]=!0,l.push(h)}b&&l.splice(0,b);var q={name:a.name,message:a.message,url:d(),stack:l};return e(q,a.sourceURL||a.fileName,a.line||a.lineNumber,a.message||a.description),q}function g(e,g){var h=null;g=null==g?0:+g;try{if(h=b(e))return h}catch(j){if(i.debug)throw j}try{if(h=a(e))return h}catch(j){if(i.debug)throw j}try{if(h=c(e))return h}catch(j){if(i.debug)throw j}try{if(h=f(e,g+1))return h}catch(j){if(i.debug)throw j}return{name:e.name,message:e.message,url:d()}}return g.augmentStackTraceWithInitialElement=e,g.computeStackTraceFromStackProp=a,g}(),b.exports=i},{6:6}]},{},[5])(5)});
//# sourceMappingURL=raven.min.js.map
{
"@dist/raven.js": {
"hashes": {
"sha256": "bTEPripl705InCCs3lTOFnM/vPJj0Qh4pYfAE8ZZ3pg=",
"sha512": "6lb2h4LW8tLdntlWW03/2NdKkBrlpQCJTizla34QzD7XyrcSy0gdp565VvjOpWMIQIxi7PaD6kL7+Ob9yr43Hw=="
"sha256": "Zpj+FDbat/vr1tCe0gTCav0TPGXfujyc3N9krTU18uM=",
"sha512": "qu4xD4PQDWOpqwDL5sUJlr8WSeB8huLcZR+SAaXcbDM22lKIe1TEfRzRec8wQ/PEPWpArXPvU+4ubYr4M8VAOg=="
},
"type": null,
"integrity": "sha256-bTEPripl705InCCs3lTOFnM/vPJj0Qh4pYfAE8ZZ3pg= sha512-6lb2h4LW8tLdntlWW03/2NdKkBrlpQCJTizla34QzD7XyrcSy0gdp565VvjOpWMIQIxi7PaD6kL7+Ob9yr43Hw==",
"integrity": "sha256-Zpj+FDbat/vr1tCe0gTCav0TPGXfujyc3N9krTU18uM= sha512-qu4xD4PQDWOpqwDL5sUJlr8WSeB8huLcZR+SAaXcbDM22lKIe1TEfRzRec8wQ/PEPWpArXPvU+4ubYr4M8VAOg==",
"path": "dist/raven.js"

@@ -13,9 +13,9 @@ },

"hashes": {
"sha256": "8gpwv4k7ehC3fCGeaTGjCjiP8v1ttVfzDxanZtKZVOY=",
"sha512": "hkWLjB58gDHaCyYwq6sV6AU9HjG1+1Xybyf4u/SHyjzTuQWfRu85t9zdSTvbDtNaKCS39Rb0SZNEpwNH2ebZYg=="
"sha256": "xVnDfVE6mVCWGYPLv0T6cKNY6Biu2u59WmNKGRVV8+8=",
"sha512": "SpxUg6Lq7VQafufvafu18jS7HZuRtAB8HkehX7mTlDufMaacU3B5DLzTBq6p+UH77D0x25Yz5nMokEPZ4sDymA=="
},
"type": null,
"integrity": "sha256-8gpwv4k7ehC3fCGeaTGjCjiP8v1ttVfzDxanZtKZVOY= sha512-hkWLjB58gDHaCyYwq6sV6AU9HjG1+1Xybyf4u/SHyjzTuQWfRu85t9zdSTvbDtNaKCS39Rb0SZNEpwNH2ebZYg==",
"integrity": "sha256-xVnDfVE6mVCWGYPLv0T6cKNY6Biu2u59WmNKGRVV8+8= sha512-SpxUg6Lq7VQafufvafu18jS7HZuRtAB8HkehX7mTlDufMaacU3B5DLzTBq6p+UH77D0x25Yz5nMokEPZ4sDymA==",
"path": "dist/raven.min.js"
}
}

@@ -131,7 +131,8 @@ 'use strict';

src: 'test/**/*.test.js',
dest: 'build/raven.test.js',
options: {
dest: 'build/raven.test.js',
options: {
browserifyOptions: {
debug: true // source maps
},
ignore: ['react-native'],
plugin: [proxyquire.plugin]

@@ -138,0 +139,0 @@ }

{
"name": "raven-js",
"version": "3.3.0",
"version": "3.4.0",
"license": "BSD-2-Clause",
"homepage": "https://getsentry.com",
"homepage": "https://github.com/getsentry/raven-js",
"scripts": {

@@ -20,2 +20,3 @@ "pretest": "npm install",

"devDependencies": {
"bluebird": "^3.4.1",
"browserify-versionify": "^1.0.6",

@@ -22,0 +23,0 @@ "bundle-collapser": "^1.2.1",

@@ -9,4 +9,5 @@ /**

// See https://github.com/angular/angular.js/blob/v1.4.7/src/minErr.js
var angularPattern = /^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.+?)\n(\S+)$/;
var angularPattern = /^\[((?:[$a-zA-Z0-9]+:)?(?:[$a-zA-Z0-9]+))\] (.*?)\n?(\S+)$/;
function angularPlugin(Raven, angular) {

@@ -42,17 +43,4 @@ angular = angular || window.angular;

Raven.setDataCallback(function(data, original) {
// We only care about mutating an exception
var exception = data.exception;
if (exception) {
exception = exception.values[0];
var matches = angularPattern.exec(exception.value);
angularPlugin._normalizeData(data);
if (matches) {
// This type now becomes something like: $rootScope:inprog
exception.type = matches[1];
exception.value = matches[2];
data.message = exception.type + ': ' + exception.value;
// auto set a new tag specifically for the angular error url
data.extra.angularDocs = matches[3].substr(0, 250);
}
}
original && original(data);

@@ -62,2 +50,21 @@ });

angularPlugin._normalizeData = function (data) {
// We only care about mutating an exception
var exception = data.exception;
if (exception) {
exception = exception.values[0];
var matches = angularPattern.exec(exception.value);
if (matches) {
// This type now becomes something like: $rootScope:inprog
exception.type = matches[1];
exception.value = matches[2];
data.message = exception.type + ': ' + exception.value;
// auto set a new tag specifically for the angular error url
data.extra.angularDocs = matches[3].substr(0, 250);
}
}
};
module.exports = angularPlugin;

@@ -15,7 +15,17 @@ /*global ErrorUtils:false*/

*
* onInitialize: A callback that fires once the plugin has fully initialized
* and checked for any previously thrown fatals. If there was a fatal, its
* data payload will be passed as the first argument of the callback.
*
*/
'use strict';
var PATH_STRIP_RE = /^\/var\/mobile\/Containers\/Bundle\/Application\/[^\/]+\/[^\.]+\.app/;
// Example React Native path format (iOS):
// /var/containers/Bundle/Application/{DEVICE_ID}/HelloWorld.app/main.jsbundle
var PATH_STRIP_RE = /^.*\/[^\.]+\.app/;
var FATAL_ERROR_KEY = '--rn-fatal--';
var ASYNC_STORAGE_KEY = '--raven-js-global-error-payload--';
/**

@@ -58,8 +68,63 @@ * Strip device-specific IDs from React Native file:// paths

// Check for a previously persisted payload, and report it.
reactNativePlugin._restorePayload()
.then(function(payload) {
options.onInitialize && options.onInitialize(payload);
if (!payload) return;
Raven._sendProcessedPayload(payload, function(error) {
if (error) return; // Try again next launch.
reactNativePlugin._clearPayload();
});
})
['catch'](function() {});
// Make sure that if multiple fatals occur, we only persist the first one.
//
// The first error is probably the most important/interesting error, and we
// want to crash ASAP, rather than potentially queueing up multiple errors.
var handlingFatal = false;
var defaultHandler = ErrorUtils.getGlobalHandler && ErrorUtils.getGlobalHandler() || ErrorUtils._globalHandler;
ErrorUtils.setGlobalHandler(function() {
Raven.setShouldSendCallback(function(data, originalCallback) {
if (!(FATAL_ERROR_KEY in data)) {
return originalCallback.call(this, data);
}
var origError = data[FATAL_ERROR_KEY];
delete data[FATAL_ERROR_KEY];
reactNativePlugin._persistPayload(data)
.then(function() {
defaultHandler(origError, true);
handlingFatal = false; // In case it isn't configured to crash.
return null;
})
['catch'](function() {});
return false; // Do not continue.
});
ErrorUtils.setGlobalHandler(function(error, isFatal) {
var captureOptions = {
timestamp: new Date() / 1000
};
var error = arguments[0];
defaultHandler.apply(this, arguments)
Raven.captureException(error);
// We want to handle fatals, but only in production mode.
var shouldHandleFatal = isFatal && !global.__DEV__;
if (shouldHandleFatal) {
if (handlingFatal) {
console.log('Encountered multiple fatals in a row. The latest:', error);
return;
}
handlingFatal = true;
// We need to preserve the original error so that it can be rethrown
// after it is persisted (see our shouldSendCallback above).
captureOptions[FATAL_ERROR_KEY] = error;
}
Raven.captureException(error, captureOptions);
// Handle non-fatals regularly.
if (!shouldHandleFatal) {
defaultHandler(error);
}
});

@@ -69,2 +134,39 @@ }

/**
* Saves the payload for a globally-thrown error, so that we can report it on
* next launch.
*
* Returns a promise that guarantees never to reject.
*/
reactNativePlugin._persistPayload = function(payload) {
var AsyncStorage = require('react-native').AsyncStorage;
return AsyncStorage.setItem(ASYNC_STORAGE_KEY, JSON.stringify(payload))
['catch'](function() { return null; });
}
/**
* Checks for any previously persisted errors (e.g. from last crash)
*
* Returns a promise that guarantees never to reject.
*/
reactNativePlugin._restorePayload = function() {
var AsyncStorage = require('react-native').AsyncStorage;
var promise = AsyncStorage.getItem(ASYNC_STORAGE_KEY)
.then(function(payload) { return JSON.parse(payload); })
['catch'](function() { return null; });
// Make sure that we fetch ASAP.
AsyncStorage.flushGetRequests();
return promise;
};
/**
* Clears any persisted payloads.
*/
reactNativePlugin._clearPayload = function() {
var AsyncStorage = require('react-native').AsyncStorage;
return AsyncStorage.removeItem(ASYNC_STORAGE_KEY)
['catch'](function() { return null; });
}
/**
* Custom HTTP transport for use with React Native applications.

@@ -85,3 +187,3 @@ */

if (options.onError) {
options.onError();
options.onError(new Error('Sentry error code: ' + request.status));
}

@@ -88,0 +190,0 @@ }

@@ -90,3 +90,3 @@ /*global XDomainRequest:false*/

// See: https://github.com/getsentry/raven-js/issues/465
VERSION: '3.3.0',
VERSION: '3.4.0',

@@ -1164,4 +1164,2 @@ debug: false,

_send: function(data) {
var self = this;
var globalOptions = this._globalOptions;

@@ -1227,2 +1225,9 @@

this._sendProcessedPayload(data);
},
_sendProcessedPayload: function(data, callback) {
var self = this;
var globalOptions = this._globalOptions;
// Send along an event_id if not explicitly passed.

@@ -1270,4 +1275,5 @@ // This event_id can be used to reference the error within Sentry itself.

});
callback && callback();
},
onError: function failure() {
onError: function failure(error) {
self._triggerEvent('failure', {

@@ -1277,2 +1283,4 @@ data: data,

});
error = error || new Error('Raven send failed (no additional details provided)');
callback && callback(error);
}

@@ -1299,3 +1307,3 @@ });

} else if (opts.onError) {
opts.onError();
opts.onError(new Error('Sentry error code: ' + request.status));
}

@@ -1302,0 +1310,0 @@ }

@@ -0,1 +1,3 @@

var Promise = require('bluebird');
var _Raven = require('../../src/raven');

@@ -11,2 +13,6 @@ var reactNativePlugin = require('../../plugins/react-native');

Raven.config('http://abc@example.com:80/2');
reactNativePlugin._persistPayload = self.sinon.stub().returns(Promise.resolve());
reactNativePlugin._restorePayload = self.sinon.stub().returns(Promise.resolve());
reactNativePlugin._clearPayload = self.sinon.stub().returns(Promise.resolve());
});

@@ -28,3 +34,3 @@

frames: [{
filename: 'file:///var/mobile/Containers/Bundle/Application/ABC/123.app/file1.js',
filename: 'file:///var/containers/Bundle/Application/ABC/123.app/file1.js',
lineno: 10,

@@ -140,14 +146,94 @@ colno: 11,

it('should call the default React Native handler and Raven.captureException', function () {
it('checks for persisted errors when starting', function () {
var onInit = self.sinon.stub();
reactNativePlugin(Raven, {onInitialize: onInit});
assert.isTrue(reactNativePlugin._restorePayload.calledOnce);
return Promise.resolve().then(function () {
assert.isTrue(onInit.calledOnce);
});
});
it('reports persisted errors', function () {
var payload = {abc: 123};
self.sinon.stub(Raven, '_sendProcessedPayload');
reactNativePlugin._restorePayload = self.sinon.stub().returns(Promise.resolve(payload));
var onInit = self.sinon.stub();
reactNativePlugin(Raven, {onInitialize: onInit});
return Promise.resolve().then(function () {
assert.isTrue(onInit.calledOnce);
assert.equal(onInit.getCall(0).args[0], payload);
assert.isTrue(Raven._sendProcessedPayload.calledOnce);
assert.equal(Raven._sendProcessedPayload.getCall(0).args[0], payload);
});
});
it('clears persisted errors after they are reported', function () {
var payload = {abc: 123};
var callback;
self.sinon.stub(Raven, '_sendProcessedPayload', function(p, cb) { callback = cb; });
reactNativePlugin._restorePayload = self.sinon.stub().returns(Promise.resolve(payload));
reactNativePlugin(Raven);
var err = new Error();
this.sinon.stub(Raven, 'captureException');
this.globalErrorHandler(err);
return Promise.resolve().then(function () {
assert.isFalse(reactNativePlugin._clearPayload.called);
callback();
assert.isTrue(reactNativePlugin._clearPayload.called);
});
});
assert.isTrue(this.defaultErrorHandler.calledOnce);
assert.isTrue(Raven.captureException.calledOnce);
assert.equal(Raven.captureException.getCall(0).args[0], err);
it('does not clear persisted errors if there is an error reporting', function () {
var payload = {abc: 123};
var callback;
self.sinon.stub(Raven, '_sendProcessedPayload', function(p, cb) { callback = cb; });
reactNativePlugin._restorePayload = self.sinon.stub().returns(Promise.resolve(payload));
reactNativePlugin(Raven);
return Promise.resolve().then(function () {
assert.isFalse(reactNativePlugin._clearPayload.called);
callback(new Error('nope'));
assert.isFalse(reactNativePlugin._clearPayload.called);
});
});
describe('in development mode', function () {
beforeEach(function () {
global.__DEV__ = true;
});
it('should call the default React Native handler and Raven.captureException', function () {
reactNativePlugin(Raven);
var err = new Error();
this.sinon.stub(Raven, 'captureException');
this.globalErrorHandler(err, true);
assert.isTrue(this.defaultErrorHandler.calledOnce);
assert.isTrue(Raven.captureException.calledOnce);
assert.equal(Raven.captureException.getCall(0).args[0], err);
});
});
describe('in production mode', function () {
beforeEach(function () {
global.__DEV__ = false;
});
it('should call the default React Native handler after persisting the error', function () {
reactNativePlugin(Raven);
var err = new Error();
this.globalErrorHandler(err, true);
assert.isTrue(reactNativePlugin._persistPayload.calledOnce);
var defaultErrorHandler = this.defaultErrorHandler;
return Promise.resolve().then(function () {
assert.isTrue(defaultErrorHandler.calledOnce);
});
});
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc