Fix error handling in publish workflow to prevent runtime panics #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The publish workflow fails with
Reflect.get called on non-objectwhen error handling attempts to access.messageon non-Error objects in the Deno runtime. This occurs in thedeno evalscripts that update version numbers during publishing.Type of Change
Changes Made
err.messageaccess witherr instanceof Error ? err.message : String(err)in 4 catch blocksBefore:
After:
Testing
deno task gensuccessfullydeno lint(noted any acceptable errors)deno check mod.tsArchitectural Decision Record (ADR)
docs/adr/docs/adr/README.mdIf ADR is required but not included, please explain why:
Documentation
Breaking Changes
None
Related Issues
Fixes #23
Additional Notes
The error message referenced
wasm/src/lib.rs:56:64but was actually a JavaScript error in Deno's runtime, not a Rust panic. The fix ensures graceful degradation regardless of error object type.Checklist
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.