error events handled properly in stremio core service

This commit is contained in:
NikolaBorislavovHristov 2019-09-24 20:15:47 +03:00
parent 143a211625
commit 9b37038d5a

View file

@ -7,17 +7,17 @@ function StremioCore() {
let starting = false;
let containerService = null;
let events = new EventEmitter();
events.on('error', () => { });
function onStateChanged() {
events.emit('stateChanged');
}
function start() {
if (active || error !== null || starting) {
if (active || error instanceof Error || starting) {
return;
}
starting = true;
events.on('error', () => { });
init()
.then(() => {
if (starting) {