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

Structured cloning of errors #165

Closed
domenic opened this issue Jun 3, 2019 · 5 comments · Fixed by #225
Closed

Structured cloning of errors #165

domenic opened this issue Jun 3, 2019 · 5 comments · Fixed by #225
Labels
position: positive venue: WHATWG Specifications in a WHATWG Workstream

Comments

@domenic
Copy link
Contributor

domenic commented Jun 3, 2019

Request for Mozilla Position on an Emerging Web Specification

Other information

This is a proposal to make various error types structured cloneable, i.e. integrate them into the structured serialize/deserialize algorithms. In particular, this is done for DOMException in the fashion of any other Web IDL interface (via [Serializable]), and is done for ECMAScript's built-in error types in a way similar to other ECMAScript built-ins like Map or Set (as part of the structured (de)serialization algorithms in HTML).

There was some discussion on the best way to handle the ECMAScript built-in error types, as they are not separately branded (i.e. there is no internal state that distinguishes TypeError from URIError); see tc39/ecma262#1389 for that discussion.

@bzbarsky brought up some points about (de)serialization of the un-speced but de-facto stack property on errors. We've discussed and decided with option 1 in whatwg/html#4268 (comment), and I'll be updating the spec PRs shortly.

/cc @yutakahirano

@bzbarsky
Copy link
Contributor

bzbarsky commented Jun 3, 2019

Fwiw, I think this is a good idea. Right now exception information can sort of make it out of a worker via "error" events on it, but when Promises are involved there's no good way I can see to propagate out error status. If the code could just postMessage the Error or DOMException involved, that would help the situation a good bit, I think.

@tschneidereit
Copy link

I also think this is a good idea, including the choice of option one with @domenic's added comment.

@yutakahirano
Copy link

I'll be updating the spec PRs shortly.

This is done.

@yutakahirano
Copy link

I have sent an intent-to-ship for this feature to blink-dev.
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/f8JngIi8qYs

@annevk
Copy link
Contributor

annevk commented Jun 20, 2019

Thanks all! I think the conclusion here is worth prototyping as important seems a tad overblown. I suspect we won't add it to the dashboard as this is a minor addition to an algorithm in the HTML Standard, but it does seem good (to me) to have reviewed it here. Shall we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
position: positive venue: WHATWG Specifications in a WHATWG Workstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants