diff --git a/js/mixins/react_error.js b/js/mixins/react_error.js index 0b7669de..1169a069 100644 --- a/js/mixins/react_error.js +++ b/js/mixins/react_error.js @@ -4,7 +4,8 @@ import invariant from 'invariant'; const ReactError = { throws(err) { - invariant(err.handler, 'You need to specify a `handler` for this error'); + invariant(err.handler, 'Error thrown to ReactError did not have a `handler` function'); + console.logGlobal('Error thrown to ReactError did not have a `handler` function'); err.handler(this, err); } }; diff --git a/js/models/errors.js b/js/models/errors.js index d7843d30..e748d953 100644 --- a/js/models/errors.js +++ b/js/models/errors.js @@ -10,7 +10,12 @@ export class ResourceNotFoundError extends Error { super(message); this.name = this.constructor.name; this.message = message; - Error.captureStackTrace(this, this.constructor.name); + + // `captureStackTrace` might not be available in IE: + // - http://stackoverflow.com/a/8460753/1263876 + if(Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor.name); + } } handler(component, err) {