-
Notifications
You must be signed in to change notification settings - Fork 125
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
More specific Error types #14
Comments
Old issue, but perhaps this could be a place for discussing error handling in One quick work around that I could think of, would be to export the data constructors for the Change That way, you could add code into your own codebase such as:
Then, you could have code that looked like:
Where Currently—with no changes—you could do something like:
But, using In case the above sounds good: #73 |
The last idea for hedis errors was just throwing exceptions - #54 (comment) |
I'm in favor of that, it would be a great change. Though, exposing the In the long term, is there any reason why |
In our project we use the following approach:
It fails if there was a error in any of the functions and returning
And if exception arrives, entire computation will be stopped propagating an This approach requires only adding a helper (and possibly a runner instead of What do you think about it? |
Currently for error conditions outside of transactions
hedis
returns aLeft (Error ByteString :: Reply)
, which confuses me a little bit.For example it was not immediately clear to me whether the error bytestring encodes only utf-8 strings. Further, it is only in the documentation where you can find that the
Left
reply will only ever contain anError
and not any of theSingleLine
,Integer
,Bulk
orMultiBulk
constructors.Wouldn't it be possible to simplify those signatures to a more straight-forward
Either Text a
? Do I understand what's going on?(PS attempting to quickly port https://github.com/scan/redissession from the deprecated
redis
tohedis
)The text was updated successfully, but these errors were encountered: