mirror of
https://github.com/ascribe/onion.git
synced 2025-01-09 13:21:44 +01:00
17 lines
412 B
JavaScript
17 lines
412 B
JavaScript
|
'use strict';
|
||
|
|
||
|
import invariant from 'invariant';
|
||
|
|
||
|
const ReactError = {
|
||
|
throws(err) {
|
||
|
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;
|