sql.js icon indicating copy to clipboard operation
sql.js copied to clipboard

Cannot reference postMessage id on error in web workers

Open jekelija opened this issue 6 years ago • 0 comments

Perhaps I am just missing it, but there doesn't seem to be a way to trace an error back to the message posted in web workers. For example, if:

this.webWorkerCatalogSQLiteDB.postMessage({ id: id, action: 'exec', sql: queryStr });

Results in an error, this gets handled in this.webWorkerCatalogSQLiteDB.onerror = (error)=> { //TODO };

However, the error object returned doesn't seem to have any reference to the id of the message posted, unlike the success message, which has an event.data.id that references back.

Any advice?

jekelija avatar Mar 20 '18 16:03 jekelija