Skip to content

Commit

Permalink
fix: added fail callback while opening the database in Cordova (#10566)
Browse files Browse the repository at this point in the history
* Added fail callback

* Added fail callback

* Removed the private flag

* Fixed comments

---------

Co-authored-by: Radu Moian-Dusa <radu.moian-dusa@kronsoft.ro>
  • Loading branch information
moianra23 and Radu Moian-Dusa committed Jan 2, 2024
1 parent 173910e commit 8b4df5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/driver/cordova/CordovaDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ export class CordovaDriver extends AbstractSqliteDriver {
this.options.extra || {},
)

const connection = await new Promise<any>((resolve) => {
this.sqlite.openDatabase(options, (db: any) => resolve(db))
const connection = await new Promise<any>((resolve, fail) => {
this.sqlite.openDatabase(
options,
(db: any) => resolve(db),
(err: any) => fail(err),
)
})

await new Promise<void>((ok, fail) => {
Expand Down

0 comments on commit 8b4df5b

Please sign in to comment.