Skip to content

Commit

Permalink
Add error info text in case of close error on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Jan 2, 2018
1 parent 760dec7 commit d452521
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changes

##### cordova-sqlite-legacy-core 1.0.7-pre5
##### cordova-sqlite-legacy-core 1.0.7

- Add error info text in case of close error on Windows
- Signal INTERNAL ERROR in case of attempt to reuse db on Windows (should never happen due to workaround solution to BUG 666)
- SQLITE_DEFAULT_CACHE_SIZE build flag fix for macOS ("osx") and Windows

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-sqlite-legacy-core",
"version": "1.0.7-pre5",
"version": "1.0.7",
"description": "Native interface to SQLite for PhoneGap/Cordova (legacy core version branch)",
"cordova": {
"id": "cordova-sqlite-legacy-core",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-sqlite-legacy-core"
version="1.0.7-pre5">
version="1.0.7">

<name>Cordova sqlite storage plugin - legacy core version branch</name>

Expand Down
16 changes: 10 additions & 6 deletions src/windows/sqlite-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,24 @@ module.exports = {
var options = args[0];
var res;
try {
//res = SQLitePluginRT.SQLitePlugin.closeAsync(JSON.stringify(options));
var dbname = options.path;

nextTick(function() {
if (!!dbmap[dbname] && dbmap[dbname].close() == 0) {
var rc = 0;
var db = dbmap[dbname];

if (!db) {
fail("CLOSE ERROR: cannot find db object for dbname: " + dbname);
} else if ((rc = db.close()) !== 0) {
fail("CLOSE ERROR CODE: " + rc);
} else {
delete dbmap[dbname];
win();
} else {
fail(); // XXX TODO REPORT ERROR
}
});
} catch (ex) {
} catch (ex) {
fail(ex);
}
//handle(res, win, fail);
},
backgroundExecuteSqlBatch: function(win, fail, args) {
var options = args[0];
Expand Down

0 comments on commit d452521

Please sign in to comment.