Enhance WASM Error Handling with Structured Error Information #10
Labels
No labels
Epic
GHA
Release
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
major
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
NiXTheDev/Ogex#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal: Allow JavaScript consumers to get detailed error information (message, position, etc.) when compilation fails.
Currently,
JsRegex::newreturnsResult<JsRegex, JsValue>where the error is a simple string. This loses span information.Proposed Change:
Create a
JsRegexErrorstruct that can be converted to a JavaScript object with fields likemessage,start,end, and possiblykind. Usewasm_bindgento export this struct.Example:
Then in
JsRegex::new, catchSpannedErrorand convert it toJsRegexError.Benefits:
Implementation Steps: