1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00
onion/js/mixins/react_error.js

17 lines
412 B
JavaScript
Raw Normal View History

'use strict';
import invariant from 'invariant';
const ReactError = {
throws(err) {
2015-12-07 11:48:28 +01:00
if(!err.handler) {
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');
} else {
err.handler(this, err);
}
}
};
export default ReactError;