Files
Hippy/core/js/modules/ExceptionHandle.js
T
XQ Kuang 80338e775e refactor(core): refactor Hippy.on(), added Hippy.off() and Hippy.emit()
1. Refactor the Hippy.on() for multiple event listener handlers.
2. Added Hippy.off() to remove the event handler.
3. Added Hippy.emit() to trigger the specific event.
2020-04-22 18:55:35 +08:00

9 lines
216 B
JavaScript

(function exceptionHandler(eventName, err) {
if (global.Hippy) {
global.Hippy.emit('uncaughtException', err);
} else {
/* eslint-disable-next-line no-console */
console.error(eventName, err);
}
});