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

popErrorScope status when stack is empty? #369

Open
kainino0x opened this issue Oct 10, 2024 · 1 comment
Open

popErrorScope status when stack is empty? #369

kainino0x opened this issue Oct 10, 2024 · 1 comment
Labels
!discuss Needs discussion (at meeting or online) errors Error reporting needs docs Non-trivial API contract needs to be documented. Orthogonal to open vs closed; remove when doc'd.

Comments

@kainino0x
Copy link
Collaborator

kainino0x commented Oct 10, 2024

In JS when the error scope stack is empty, popErrorScope rejects with OperationError. What should we do in C?

Emscripten and Dawn currently translate it to Unknown plus a message string. However we also use Unknown in Emscripten if the error type is some unexpected object (e.g. if we add one to the JS API in the future).

We should also say what the message string is. I think it must be empty if the status is NoError and it should be non-empty for any other status. (since message can't be null anymore)

@kainino0x kainino0x added !discuss Needs discussion (at meeting or online) needs docs Non-trivial API contract needs to be documented. Orthogonal to open vs closed; remove when doc'd. errors Error reporting labels Oct 10, 2024
@lokokung
Copy link
Collaborator

Hmm, that's a good point. In C, there's only Success and InstanceDropped on WGPUPopErrorScopeStatus. Maybe we could add another case there instead of modifying the error type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!discuss Needs discussion (at meeting or online) errors Error reporting needs docs Non-trivial API contract needs to be documented. Orthogonal to open vs closed; remove when doc'd.
Projects
None yet
Development

No branches or pull requests

2 participants