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

Naming/RescuedExceptionsVariableName can cause a variable to be shadowed from outside the rescue block #9588

Closed
dvandersluis opened this issue Mar 10, 2021 · 0 comments · Fixed by #9961
Labels

Comments

@dvandersluis
Copy link
Member

Follows #9587. This test fails:

context 'shadowing an external variable' do
  it 'does not register an offense' do
    expect_no_offenses(<<~RUBY)
      e = 'error message'
      begin
        something
      rescue StandardError => e1
        log(e, e1)
      end
    RUBY
  end
end
@dvandersluis dvandersluis self-assigned this Mar 10, 2021
@dvandersluis dvandersluis removed their assignment May 16, 2021
koic added a commit that referenced this issue Sep 28, 2021
…-exceptions-variable-name

[Fix #9588] Fix causing a variable to be shadowed from outside the rescue block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant