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

"catch" should always come after "rescue" in try [Question] #228

Closed
JohnKacz opened this issue Dec 13, 2018 · 1 comment
Closed

"catch" should always come after "rescue" in try [Question] #228

JohnKacz opened this issue Dec 13, 2018 · 1 comment

Comments

@JohnKacz
Copy link

Not a big issue and simple to fix, but I wanted to create an issue partly to better understand why both catch and rescue are needed. I'm assuming because send_req/4 can "fail" in a lot of different ways?

Compiling gives a warning

==> hound
Compiling 16 files (.ex)
warning: "catch" should always come after "rescue" in try
  lib/hound/request_utils.ex:9

try do
case send_req(type, path, params, options) do
{:error, _} -> make_retry(type, path, params, options, retries)
result -> result
end
catch
_ -> make_retry(type, path, params, options, retries)
rescue
_ -> make_retry(type, path, params, options, retries)
end

Elixir 1.7.4

@danhper
Copy link
Collaborator

danhper commented Mar 20, 2019

Thanks for reporting. This should be fixed in the latest version.

@danhper danhper closed this as completed Mar 20, 2019
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

No branches or pull requests

2 participants