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

Re-raise redix errors as Exq.RedisError #379

Open
coop opened this issue May 30, 2019 · 0 comments
Open

Re-raise redix errors as Exq.RedisError #379

coop opened this issue May 30, 2019 · 0 comments

Comments

@coop
Copy link

coop commented May 30, 2019

In my bug tracker I'm starting to see a fair few of these:

no match of right hand side value: {:error, %Redix.ConnectionError{reason: :timeout}}

Which is being called from Exq.Redis.Connection.zcard!/2etc. Having a look at the implementation each of the bang functions expect an ok tuple (which is fine). Just wondering if you'd be open to a pull request which catches the error and reraises with something specific to Exq so that I can filter out just those exceptions and not all redix connection errors?

I was thinking something like:

def zcard!(redis, x) do
  case current_implementation() do
    {:ok, value} -> value
    {:error, reason} -> raise Exq.RedisError, reason
end

Thoughts?

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

1 participant