Database exception handling

This commit is contained in:
Mo Bitar
2020-03-25 22:04:14 -05:00
parent a80a94de5e
commit 9d6c32890a
6 changed files with 96 additions and 98 deletions

View File

@@ -64,12 +64,14 @@ export class WebDeviceInterface extends DeviceInterface {
async openDatabase() {
this.database.unlock();
return new Promise((resolve) => {
return new Promise((resolve, reject) => {
this.database.openDatabase(() => {
resolve({ isNewDatabase: true });
}).then(() => {
resolve({ isNewDatabase: false });
});
}).catch((error => {
reject(error);
}));
});
}