Emit error on init (#940)

This commit is contained in:
Jaco Greeff
2019-05-22 10:32:10 +02:00
committed by GitHub
parent 2ebd1e1dbb
commit c431815c4d
+6 -2
View File
@@ -391,8 +391,12 @@ export default abstract class ApiBase<CodecResult, SubscriptionResult> implement
// ignore
});
}, KEEPALIVE_INTERVAL);
} catch (error) {
l.error('FATAL: Unable to initialize the API: ', error.message);
} catch (_error) {
const error = new Error(`FATAL: Unable to initialize the API: ${_error.message}`);
l.error(error);
this.emit('error', error);
}
});
}