honeybadger-js
Advanced tools
Comparing version 0.4.7 to 0.4.8
{ | ||
"name": "honeybadger", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"homepage": "https://github.com/honeybadger-io/honeybadger-js", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -8,2 +8,9 @@ # Change Log | ||
## [0.4.8] - 2017-05-25 | ||
### Added | ||
- Allow error messages to be ignored. - @mhuerster | ||
### Fixed | ||
- Fixed "'prototype' is undefined" bug. | ||
## [0.4.7] - 2017-04-20 | ||
@@ -10,0 +17,0 @@ ### Fixed |
/* | ||
honeybadger.js v0.4.7 | ||
honeybadger.js v0.4.8 | ||
A JavaScript Notifier for Honeybadger | ||
@@ -52,3 +52,3 @@ https://github.com/honeybadger-io/honeybadger-js | ||
}(this, function () { | ||
var VERSION = '0.4.7', | ||
var VERSION = '0.4.8', | ||
NOTIFIER = { | ||
@@ -85,2 +85,12 @@ name: 'honeybadger.js', | ||
function isIgnored(err, patterns) { | ||
var msg = err.message; | ||
for (p in patterns) { | ||
if (msg.match(patterns[p])) { return true; } | ||
} | ||
return false; | ||
} | ||
function cgiData() { | ||
@@ -285,6 +295,6 @@ var data = {}; | ||
if (checkHandlers(self.beforeNotifyHandlers, err)) { | ||
return false; | ||
} | ||
if (isIgnored(err, config('ignorePatterns'))) { return false; } | ||
if (checkHandlers(self.beforeNotifyHandlers, err)) { return false; } | ||
var data = cgiData(); | ||
@@ -338,2 +348,7 @@ if (typeof err.cookies === 'string') { | ||
function objectIsExtensible(obj) { | ||
if (typeof Object.isExtensible !== 'function') { return true; } | ||
return Object.isExtensible(obj); | ||
} | ||
var preferCatch = true; | ||
@@ -355,5 +370,4 @@ // IE < 10 | ||
try { | ||
if (typeof fn !== 'function') { | ||
return fn; | ||
} | ||
if (typeof fn !== 'function') { return fn; } | ||
if (!objectIsExtensible(fn)) { return fn; } | ||
if (!fn.___hb) { | ||
@@ -488,3 +502,3 @@ fn.___hb = function() { | ||
'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'.replace(/\w+/g, function (prop) { | ||
prototype = window[prop] && window[prop].prototype; | ||
var prototype = window[prop] && window[prop].prototype; | ||
if (prototype && prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) { | ||
@@ -491,0 +505,0 @@ instrument(prototype, 'addEventListener', function(original) { |
{ | ||
"name": "honeybadger-js", | ||
"description": "A JavaScript library for integrating apps with the Honeybadger Rails Error Notifier.", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"homepage": "https://github.com/honeybadger-io/honeybadger-js", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -142,2 +142,6 @@ # Honeybadger Client-Side Javascript Library | ||
// Ignore Patterns (optional) | ||
// Array of error messages as regexes that should be ignored | ||
ignorePatterns: [/known\ error/i], | ||
// Should unhandled (window.onerror) notifications be sent? | ||
@@ -144,0 +148,0 @@ onerror: true, |
@@ -214,2 +214,15 @@ var url = 'global'; | ||
it('does not deliver notice for ignored message', function() { | ||
Honeybadger.configure({ | ||
api_key: 'asdf', | ||
ignorePatterns: [/care/i] | ||
}); | ||
var notice = Honeybadger.notify("Honeybadger don't care, but you might."); | ||
afterNotify(function() { | ||
expect(requests.length).toEqual(0); | ||
}); | ||
}); | ||
it('generates a stack trace without an error', function() { | ||
@@ -417,2 +430,9 @@ Honeybadger.configure({ | ||
}); | ||
if (typeof Object.freeze === 'function') { | ||
it('returns original function if fn is not extensible', function() { | ||
var func = Object.freeze(function() {}); | ||
expect(Honeybadger.wrap(func)).toEqual(func); | ||
}); | ||
} | ||
}); | ||
@@ -419,0 +439,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
388963
9766
452