freedomjs / freedom-pgp-e2e

Wrapping up end-to-end code and provide in freedom custom API.
34 stars 6 forks source link

Error handling issues in playground (and possibly beyond) #53

Closed agallant closed 8 years ago

agallant commented 8 years ago

Formerly when functions returned with Promise.reject(Error('some error message')), the playgrounf would handle and print that message. Now this happens (in Chrome at least - in Firefox the error just seems silent):

worker.js:111 Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 
'DedicatedWorkerGlobalScope': An object could not be cloned.(…)
WorkerLink.deliverMessage @ worker.js:111
Link.onMessage @ link.js:39
Hub.onMessage @ hub.js:59
(anonymous function) @ util.js:224
(anonymous function) @ provider.js:339

Initial investigation suggests this has something to do with serializing the error to/from a string and passing it around (namely it can't be cloned while it's an Error, only while it's a string). The actual fix is likely in freedom.js internals somewhere, but filing here as this is where I encountered it. It's unclear if this arose due to changes in freedom.js, browsers, or some dependency.

agallant commented 8 years ago

Resolved - https://github.com/freedomjs/freedom/wiki/Raising-Errors