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

Errno::EAGAIN != Errno::EWOULDBLOCK #4843

Closed
reitermarkus opened this issue Oct 6, 2017 · 1 comment · Fixed by #4844
Closed

Errno::EAGAIN != Errno::EWOULDBLOCK #4843

reitermarkus opened this issue Oct 6, 2017 · 1 comment · Fixed by #4844
Labels

Comments

@reitermarkus
Copy link
Contributor

Expected behavior

Running RuboCop on a file with the contents

begin
rescue Errno::EAGAIN, Errno::EWOULDBLOCK
  raise
end

should not show an error, since they may be the same, but don't have to be.

Actual behavior

The following offense is detected:

errno.rb:2:1: W: Do not shadow rescued Exceptions.
rescue Errno::EAGAIN, Errno::EWOULDBLOCK
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RuboCop version

$ rubocop -V
0.50.0 (using Parser 2.4.0.0, running on ruby 2.3.3 universal.x86_64-darwin17)
@Drenmi Drenmi added the bug label Oct 6, 2017
@Drenmi
Copy link
Collaborator

Drenmi commented Oct 6, 2017

Interesting edge case. As far as the Ruby on your system is concerned, they are the same, but that may not be the case on the machine running in production ...

koic added a commit to koic/rubocop that referenced this issue Oct 7, 2017
Note: System dependent error code depends on runtime environment.
bbatsov pushed a commit that referenced this issue Oct 9, 2017
* [Fix #4843] Fix shadow rescued Exceptions of same error code

Note: System dependent error code depends on runtime environment.
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.

2 participants