fix(portal-api): handle connection error

This commit is contained in:
Sérgio Ramos 2017-09-13 10:39:12 +01:00
parent a58be6be37
commit 9eda12e75d
1 changed files with 4 additions and 0 deletions

View File

@ -159,6 +159,10 @@ class Data extends EventEmitter {
}
this._db._exists((err, exists) => {
if (err) {
return cb(err);
}
if (exists) {
const tables = this._db._normalizeTables(internals.tables);
this._db.table(tables);