Skip to content

Commit

Permalink
3.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Oct 2, 2017
1 parent b771bb2 commit cd9082a
Show file tree
Hide file tree
Showing 25 changed files with 5,233 additions and 2,510 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 3.18.0

* NEW: All unit and integration tests are now running on CI using SauceLabs, to ensure everything is working correctly on all browsers https://github.com/getsentry/raven-js/pull/1026
* NEW: `console.assert` is now instrumented in the same way as the rest of `console` methods https://github.com/getsentry/raven-js/pull/1044
* NEW: Vue.js plugin now provides `lifecycleHook` as the 3rd argument to error handler, to make it in line with v2.2.0 implementation https://github.com/getsentry/raven-js/pull/1053
* NEW: Updated Errors serialization to store all additional properties and allow for attaching other object instances directly to it https://github.com/getsentry/raven-js/pull/1060
* NEW: Included exception type in `ignoreErrors` test, which allows for filtering based on error types https://github.com/getsentry/raven-js/pull/1057
* CHANGE: Raven.js now uses Prettier to format it's code https://github.com/getsentry/raven-js/pull/1020
* CHANGE: Unit tests are using Headless Chrome instead of PhantomJS https://github.com/getsentry/raven-js/pull/1029
* CHANGE: Added `setDSN` typing definition for TypeScript https://github.com/getsentry/raven-js/pull/995
* BUGFIX: Defend against undefined `XMLHttpRequest` while sending events https://github.com/getsentry/raven-js/pull/1024
* BUGFIX: `lastEventId` won't be overriden when an event was dropped https://github.com/getsentry/raven-js/pull/1041
* BUGFIX: Make sure that `document` is available before reading `location` https://github.com/getsentry/raven-js/pull/1038
* BUGFIX: Prevent breadcrumbs with undefined url to throw an error https://github.com/getsentry/raven-js/pull/1018

## 3.17.0
* CHANGE: Export TypeScript definitions as a CommonJS module. See: https://github.com/getsentry/raven-js/pull/977

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raven-js",
"version": "3.17.0",
"version": "3.18.0",
"dependencies": {},
"main": "dist/raven.js",
"ignore": [
Expand Down
289 changes: 180 additions & 109 deletions dist/plugins/angular.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.17.0 (6384830) | github.com/getsentry/raven-js */
/*! Raven.js 3.18.0 (b771bb2) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand All @@ -10,115 +10,186 @@
*
*/

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g=(g.Raven||(g.Raven = {}));g=(g.Plugins||(g.Plugins = {}));g.Angular = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/**
* Angular.js plugin
*
* Provides an $exceptionHandler for Angular.js
*/
'use strict';

var wrappedCallback = _dereq_(2).wrappedCallback;

// 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 moduleName = 'ngRaven';


function angularPlugin(Raven, angular) {
angular = angular || window.angular;

if (!angular) return;

function RavenProvider() {
this.$get = ['$window', function($window) {
return Raven;
}];
}

function ExceptionHandlerProvider($provide) {
$provide.decorator('$exceptionHandler',
['Raven', '$delegate', exceptionHandler]);
}

function exceptionHandler(R, $delegate) {
return function (ex, cause) {
R.captureException(ex, {
extra: { cause: cause }
});
$delegate(ex, cause);
};
}

angular.module(moduleName, [])
.provider('Raven', RavenProvider)
.config(['$provide', ExceptionHandlerProvider]);

Raven.setDataCallback(wrappedCallback(function(data) {
return angularPlugin._normalizeData(data);
}));
}

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);
}
(function(f) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = f();
} else if (typeof define === 'function' && define.amd) {
define([], f);
} else {
var g;
if (typeof window !== 'undefined') {
g = window;
} else if (typeof global !== 'undefined') {
g = global;
} else if (typeof self !== 'undefined') {
g = self;
} else {
g = this;
}

return data;
};

angularPlugin.moduleName = moduleName;

module.exports = angularPlugin;

},{"2":2}],2:[function(_dereq_,module,exports){
'use strict';

function isObject(what) {
return typeof what === 'object' && what !== null;
}

// Yanked from https://git.io/vS8DV re-used under CC0
// with some tiny modifications
function isError(value) {
switch ({}.toString.call(value)) {
case '[object Error]': return true;
case '[object Exception]': return true;
case '[object DOMException]': return true;
default: return value instanceof Error;
g = g.Raven || (g.Raven = {});
g = g.Plugins || (g.Plugins = {});
g.Angular = f();
}
}

function wrappedCallback(callback) {
function dataCallback(data, original) {
var normalizedData = callback(data) || data;
if (original) {
return original(normalizedData) || normalizedData;
})(function() {
var define, module, exports;
return (function e(t, n, r) {
function s(o, u) {
if (!n[o]) {
if (!t[o]) {
var a = typeof require == 'function' && require;
if (!u && a) return a(o, !0);
if (i) return i(o, !0);
var f = new Error("Cannot find module '" + o + "'");
throw ((f.code = 'MODULE_NOT_FOUND'), f);
}
var l = (n[o] = {exports: {}});
t[o][0].call(
l.exports,
function(e) {
var n = t[o][1][e];
return s(n ? n : e);
},
l,
l.exports,
e,
t,
n,
r
);
}
return normalizedData;
return n[o].exports;
}

return dataCallback;
}

module.exports = {
isObject: isObject,
isError: isError,
wrappedCallback: wrappedCallback
};

},{}]},{},[1])(1)
});
var i = typeof require == 'function' && require;
for (var o = 0; o < r.length; o++) s(r[o]);
return s;
})(
{
1: [
function(_dereq_, module, exports) {
/**
* Angular.js plugin
*
* Provides an $exceptionHandler for Angular.js
*/
var wrappedCallback = _dereq_(2).wrappedCallback;

// 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 moduleName = 'ngRaven';

function angularPlugin(Raven, angular) {
angular = angular || window.angular;

if (!angular) return;

function RavenProvider() {
this.$get = [
'$window',
function($window) {
return Raven;
}
];
}

function ExceptionHandlerProvider($provide) {
$provide.decorator('$exceptionHandler', [
'Raven',
'$delegate',
exceptionHandler
]);
}

function exceptionHandler(R, $delegate) {
return function(ex, cause) {
R.captureException(ex, {
extra: {cause: cause}
});
$delegate(ex, cause);
};
}

angular
.module(moduleName, [])
.provider('Raven', RavenProvider)
.config(['$provide', ExceptionHandlerProvider]);

Raven.setDataCallback(
wrappedCallback(function(data) {
return angularPlugin._normalizeData(data);
})
);
}

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);
}
}

return data;
};

angularPlugin.moduleName = moduleName;

module.exports = angularPlugin;
},
{'2': 2}
],
2: [
function(_dereq_, module, exports) {
function isObject(what) {
return typeof what === 'object' && what !== null;
}

// Yanked from https://git.io/vS8DV re-used under CC0
// with some tiny modifications
function isError(value) {
switch ({}.toString.call(value)) {
case '[object Error]':
return true;
case '[object Exception]':
return true;
case '[object DOMException]':
return true;
default:
return value instanceof Error;
}
}

function wrappedCallback(callback) {
function dataCallback(data, original) {
var normalizedData = callback(data) || data;
if (original) {
return original(normalizedData) || normalizedData;
}
return normalizedData;
}

return dataCallback;
}

module.exports = {
isObject: isObject,
isError: isError,
wrappedCallback: wrappedCallback
};
},
{}
]
},
{},
[1]
)(1);
});
Loading

0 comments on commit cd9082a

Please sign in to comment.