Skip to content

Re-raise redix errors as Exq.RedisError #379

@coop

Description

@coop

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions