Skip to content

[Bug #21551] Enhance Ractor::IsolationError with outer_variables, yield_called - #16175

Open
AlexaCampusano wants to merge 1 commit into
ruby:masterfrom
AlexaCampusano:enhace_ractor_isolation_error_information
Open

[Bug #21551] Enhance Ractor::IsolationError with outer_variables, yield_called#16175
AlexaCampusano wants to merge 1 commit into
ruby:masterfrom
AlexaCampusano:enhace_ractor_isolation_error_information

Conversation

@AlexaCampusano

Copy link
Copy Markdown
Contributor

Follow up from #16163

On its predecessor, I worked on raising Ractor::IsolationError rather than ArgumentError for isolation related errors such as accessing outer variables inside a Ractor, or yielding.

This PR enriches the Ractor::IsolationError class with two new attributes:

  • outer_variables — returns the list of outer variable names referenced in the block
  • yield_called — returns whether the block uses yield

The purpose of these additions is to provide context about what caused the isolation violation, which can be used in a follow-up PR to improve ErrorHighlight support for these errors.

…ield sign in order to have better error highlighting
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