diff options
author | stephan <stephan@noemail.net> | 2022-09-21 14:02:47 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-09-21 14:02:47 +0000 |
commit | e8afca3f16c7c2a68e4f18a615f0efc0d3203c1b (patch) | |
tree | 5adfd6269dafe1d1e5bea4490499e85d4ded0cc3 /ext/wasm/sqlite3-opfs-async-proxy.js | |
parent | 72ab400d4db6a429bf2a2758c1c39afc5178f530 (diff) | |
download | sqlite-e8afca3f16c7c2a68e4f18a615f0efc0d3203c1b.tar.gz sqlite-e8afca3f16c7c2a68e4f18a615f0efc0d3203c1b.zip |
Correct mistyped --shrink-memory flag in speedtest1-worker. Minor OPFS proxy cleanups.
FossilOrigin-Name: 86e2b55ec9483fa5add51a479c6509d73461f1ac6fca5d49e057b1c66f4314d2
Diffstat (limited to 'ext/wasm/sqlite3-opfs-async-proxy.js')
-rw-r--r-- | ext/wasm/sqlite3-opfs-async-proxy.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/ext/wasm/sqlite3-opfs-async-proxy.js b/ext/wasm/sqlite3-opfs-async-proxy.js index 06bc235ab..6c0765c63 100644 --- a/ext/wasm/sqlite3-opfs-async-proxy.js +++ b/ext/wasm/sqlite3-opfs-async-proxy.js @@ -190,7 +190,7 @@ const vfsAsyncImpls = { try { await getDirForPath(dirname+"/filepart", true); }catch(e){ - state.s11n.serialize(e.message); + state.s11n.storeException(e); rc = state.sq3Codes.SQLITE_IOERR; }finally{ wTimeEnd(); @@ -217,7 +217,7 @@ const vfsAsyncImpls = { const [dh, fn] = await getDirForPath(filename); await dh.getFileHandle(fn); }catch(e){ - state.s11n.serialize(e.message); + state.s11n.storeException(e); rc = state.sq3Codes.SQLITE_IOERR; }finally{ wTimeEnd(); @@ -278,7 +278,7 @@ const vfsAsyncImpls = { filename = filename.join('/'); } }catch(e){ - state.s11n.serialize(e.message); + state.s11n.storeException(e); rc = state.sq3Codes.SQLITE_IOERR_DELETE; } wTimeEnd(); @@ -294,7 +294,7 @@ const vfsAsyncImpls = { state.s11n.serialize(Number(sz)); sz = 0; }catch(e){ - state.s11n.serialize(e.message); + state.s11n.storeException(e); sz = state.sq3Codes.SQLITE_IOERR; } wTimeEnd(); @@ -339,7 +339,7 @@ const vfsAsyncImpls = { }catch(e){ wTimeEnd(); error(opName,e); - state.s11n.serialize(e.message); + state.s11n.storeException(e); storeAndNotify(opName, state.sq3Codes.SQLITE_IOERR); } mTimeEnd(); @@ -361,7 +361,7 @@ const vfsAsyncImpls = { } }catch(e){ error("xRead() failed",e,fh); - state.s11n.serialize(e.message); + state.s11n.storeException(e); rc = state.sq3Codes.SQLITE_IOERR_READ; } storeAndNotify('xRead',rc); @@ -376,7 +376,7 @@ const vfsAsyncImpls = { wTimeStart('xSync'); await fh.accessHandle.flush(); }catch(e){ - state.s11n.serialize(e.message); + state.s11n.storeException(e); }finally{ wTimeEnd(); } @@ -394,7 +394,7 @@ const vfsAsyncImpls = { await fh.accessHandle.truncate(size); }catch(e){ error("xTruncate():",e,fh); - state.s11n.serialize(e.message); + state.s11n.storeException(e); rc = state.sq3Codes.SQLITE_IOERR_TRUNCATE; } wTimeEnd(); @@ -414,7 +414,7 @@ const vfsAsyncImpls = { ) ? 0 : state.sq3Codes.SQLITE_IOERR_WRITE; }catch(e){ error("xWrite():",e,fh); - state.s11n.serialize(e.message); + state.s11n.storeException(e); rc = state.sq3Codes.SQLITE_IOERR_WRITE; }finally{ wTimeEnd(); @@ -517,6 +517,11 @@ const initS11n = ()=>{ } metrics.s11n.serialize.time += performance.now() - t; }; + + state.s11n.storeException = state.asyncS11nExceptions + ? ((e)=>state.s11n.serialize(e.message)) + : ()=>{}; + return state.s11n; }/*initS11n()*/; @@ -570,6 +575,7 @@ navigator.storage.getDirectory().then(function(d){ /* Receive shared state from synchronous partner */ const opt = data.args; state.littleEndian = opt.littleEndian; + state.asyncS11nExceptions = opt.asyncS11nExceptions; state.verbose = opt.verbose ?? 2; state.fileBufferSize = opt.fileBufferSize; state.sabS11nOffset = opt.sabS11nOffset; |