We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rescue
I recently learned in a rescue block, you do not have to provide a variable name if you do not need access to the exception instance. E.g.
begin raise MyException.new("OH NO!") rescue MyException puts "Rescued MyException" end # Output: Rescued MyException
works just fine.
Similar to how ameba will flag unused local/block variables, I'm wondering if it should also flag cases like:
begin raise MyException.new("OH NO!") rescue ex : MyException puts "Rescued MyException" end
where the ex variable is unused, and suggest changing it to rescue MyException.
ex
rescue MyException
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I recently learned in a
rescue
block, you do not have to provide a variable name if you do not need access to the exception instance. E.g.works just fine.
Similar to how ameba will flag unused local/block variables, I'm wondering if it should also flag cases like:
where the
ex
variable is unused, and suggest changing it torescue MyException
.The text was updated successfully, but these errors were encountered: