Skip to content

fix: catch panics in NIF to prevent BEAM crash#10

Closed
brentjanderson wants to merge 1 commit intomainfrom
bja-catch-unwind-on-inline-css
Closed

fix: catch panics in NIF to prevent BEAM crash#10
brentjanderson wants to merge 1 commit intomainfrom
bja-catch-unwind-on-inline-css

Conversation

@brentjanderson
Copy link

Description

Wraps the css inlining logic in std::panic::catch_unwind so any unexpected Rust panic is converted to a RustlerError instead of aborting the BEAM VM.

This solution was derived from a Claude code session, so take it with a hefty grain of salt. I have not personally vetted it, as I'm not a Rust expert. Even so, it seems to compile and the concept makes sense - assuming potential SEGFAULTs here are not due to some other memory allocation issue.

Wraps the css inlining logic in `std::panic::catch_unwind` so any
unexpected Rust panic is converted to a RustlerError instead of
aborting the BEAM VM.
@brentjanderson
Copy link
Author

This doesn't fix it, unfortunately. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant