From 9eda12e75d568555edad9f94e1a001251ab6871c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 13 Sep 2017 10:39:12 +0100 Subject: [PATCH] fix(portal-api): handle connection error --- packages/portal-api/lib/data/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/portal-api/lib/data/index.js b/packages/portal-api/lib/data/index.js index 10e704c8..817decc9 100644 --- a/packages/portal-api/lib/data/index.js +++ b/packages/portal-api/lib/data/index.js @@ -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);