The Wayback Machine - https://web.archive.org/web/20210124105406/https://github.com/sql-js/sql.js/issues/269
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM error cod if not loading (not working worker.onerror) #269

Open
zirill opened this issue May 11, 2019 · 2 comments
Open

WASM error cod if not loading (not working worker.onerror) #269

zirill opened this issue May 11, 2019 · 2 comments

Comments

@zirill
Copy link

@zirill zirill commented May 11, 2019

How to catch the error, not loading the WASM file?

For example: if it is blocked - an ad blocker.

PS: not working worker.onerror in wasm

@zirill zirill changed the title WSAM error cod if not loading WASM error cod if not loading May 11, 2019
@zirill zirill changed the title WASM error cod if not loading WASM error cod if not loading (not working worker.onerror) May 11, 2019
@zirill
Copy link
Author

@zirill zirill commented May 19, 2019

http://kripken.github.io/sql.js/examples/GUI/

Test code error:
CREATE TABLE test;

Console:
worker.sql-wasm.js:82 Uncaught (in promise) Error: near ";": syntax error at a.handleError (worker.sql-wasm.js:82) at a.exec (worker.sql-wasm.js:79) at worker.sql-wasm.js:243

PS: event onerror not working

@zirill
Copy link
Author

@zirill zirill commented May 19, 2019

my bad decision:

Database.prototype.handleError = function (returnCode) { var errmsg; if (returnCode === SQLite.OK) { return null; } else { errmsg = sqlite3_errmsg(this.db); setTimeout(function() { throw new Error(errmsg); }); throw new Error(errmsg); } };

https://stackoverflow.com/questions/39992417/how-to-bubble-a-web-worker-error-in-a-promise-via-worker-onerror

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant