backend-common: restore informative error message for database check

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-06-15 17:51:34 +02:00
committed by GitHub
parent 05c98f1f79
commit a4a96e424a
@@ -203,7 +203,14 @@ export class DatabaseManager {
this.getConfigForPlugin(pluginId) as JsonObject,
);
await ensureDatabaseExists(pluginConfig, this.getDatabaseName(pluginId));
const databaseName = this.getDatabaseName(pluginId);
try {
await ensureDatabaseExists(pluginConfig, databaseName);
} catch (error) {
throw new Error(
`Failed to connect to the database to make sure that '${databaseName}' exists, ${error}`,
);
}
return createDatabaseClient(
pluginConfig,