-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
2.1.0 #481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.1.0 #481
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/*! Raven.js 2.1.0 (9ca11cd) | github.com/getsentry/raven-js */ | ||
|
||
/* | ||
* Includes TraceKit | ||
* https://github.com/getsentry/TraceKit | ||
* | ||
* Copyright 2016 Matt Robenolt and other contributors | ||
* Released under the BSD license | ||
* https://github.com/getsentry/raven-js/blob/master/LICENSE | ||
* | ||
*/ | ||
|
||
(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'; | ||
|
||
// 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+)$/; | ||
|
||
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('ngRaven', []) | ||
.provider('Raven', RavenProvider) | ||
.config(['$provide', ExceptionHandlerProvider]); | ||
|
||
Raven.setDataCallback(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; | ||
|
||
},{}]},{},[1])(1) | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/*! Raven.js 2.1.0 (9ca11cd) | github.com/getsentry/raven-js */ | ||
|
||
/* | ||
* Includes TraceKit | ||
* https://github.com/getsentry/TraceKit | ||
* | ||
* Copyright 2016 Matt Robenolt and other contributors | ||
* Released under the BSD license | ||
* https://github.com/getsentry/raven-js/blob/master/LICENSE | ||
* | ||
*/ | ||
|
||
(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.Console = 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){ | ||
/** | ||
* console plugin | ||
* | ||
* Monkey patches console.* calls into Sentry messages with | ||
* their appropriate log levels. (Experimental) | ||
*/ | ||
'use strict'; | ||
|
||
function consolePlugin(Raven, console) { | ||
console = console || window.console || {}; | ||
|
||
var originalConsole = console, | ||
logLevels = ['debug', 'info', 'warn', 'error'], | ||
level = logLevels.pop(); | ||
|
||
var logForGivenLevel = function(l) { | ||
var originalConsoleLevel = console[l]; | ||
|
||
// warning level is the only level that doesn't map up | ||
// correctly with what Sentry expects. | ||
if (l === 'warn') l = 'warning'; | ||
return function () { | ||
var args = [].slice.call(arguments); | ||
Raven.captureMessage('' + args.join(' '), {level: l, logger: 'console', extra: { 'arguments': args }}); | ||
|
||
// this fails for some browsers. :( | ||
if (originalConsoleLevel) { | ||
// IE9 doesn't allow calling apply on console functions directly | ||
// See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193 | ||
Function.prototype.apply.call( | ||
originalConsoleLevel, | ||
originalConsole, | ||
args | ||
); | ||
} | ||
}; | ||
}; | ||
|
||
|
||
while(level) { | ||
console[level] = logForGivenLevel(level); | ||
level = logLevels.pop(); | ||
} | ||
} | ||
|
||
module.exports = consolePlugin; | ||
|
||
},{}]},{},[1])(1) | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*! Raven.js 2.1.0 (9ca11cd) | github.com/getsentry/raven-js */ | ||
|
||
/* | ||
* Includes TraceKit | ||
* https://github.com/getsentry/TraceKit | ||
* | ||
* Copyright 2016 Matt Robenolt and other contributors | ||
* Released under the BSD license | ||
* https://github.com/getsentry/raven-js/blob/master/LICENSE | ||
* | ||
*/ | ||
|
||
(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.Ember = 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){ | ||
/** | ||
* Ember.js plugin | ||
* | ||
* Patches event handler callbacks and ajax callbacks. | ||
*/ | ||
'use strict'; | ||
|
||
function emberPlugin(Raven, Ember) { | ||
Ember = Ember || window.Ember; | ||
|
||
// quit if Ember isn't on the page | ||
if (!Ember) return; | ||
|
||
var _oldOnError = Ember.onerror; | ||
Ember.onerror = function EmberOnError(error) { | ||
Raven.captureException(error); | ||
if (typeof _oldOnError === 'function') { | ||
_oldOnError.call(this, error); | ||
} | ||
}; | ||
Ember.RSVP.on('error', function (reason) { | ||
if (reason instanceof Error) { | ||
Raven.captureException(reason, {extra: {context: 'Unhandled Promise error detected'}}); | ||
} else { | ||
Raven.captureMessage('Unhandled Promise error detected', {extra: {reason: reason}}); | ||
} | ||
}); | ||
} | ||
|
||
module.exports = emberPlugin; | ||
|
||
},{}]},{},[1])(1) | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be worth noting the
Error.stackTraceLimit
being set.#419
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done