@hi18n/core
Version:
Message internationalization meets immutability and type-safety - core runtime
33 lines (28 loc) • 641 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defaultErrorHandler = defaultErrorHandler;
/**
* Error level. Diagnostics less important than these levels directly go to console.
*
* @since 0.1.7 (`@hi18n/core`)
*/
/**
* @since 0.1.7 (`@hi18n/core`)
*/
/**
* By default, it just throws the error if `level === "error"` and reports in the console otherwise.
*
* @since 0.1.7 (`@hi18n/core`)
*/
function defaultErrorHandler(e, level) {
switch (level) {
case "error":
throw e;
case "warn":
console.warn(e);
break;
}
}
//# sourceMappingURL=error-handling.js.map