-
Notifications
You must be signed in to change notification settings - Fork 183
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
Changes for (Add IsParseError() documentation #578) #581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
README.md
Outdated
|
||
```golang | ||
// Attempt to parse the response. If a parsing error occurs, check if the error is a parse error and handle it. | ||
if err := client.Do(ctx, client.B().Get().Key("k").Build()).AsInt64(); IsParseErr(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err := client.Do(ctx, client.B().Get().Key("k").Build()).AsInt64(); IsParseErr(err) { | |
if err := client.Do(ctx, client.B().Get().Key("k").Build()).ToArray(); IsParseErr(err) { |
Hi @karimalzalek, thank you for fixing the document but your example, GET+AsInt64
, will not return an errParse. Maybe using something like ToArray
as an example will be less confusing.
Also, could you help us emphasize that a user should normally fix the code by choosing the correct parser function, not using IsParseErr
, in the comment?
Hello @rueian , I changed the example to |
Hi @karimalzalek, the PR looks good to me but please remove the |
Removing wrong settings.json file
@rueian yup, I removed the wrong config file, not sure how that made it's way through 😂 |
Co-authored-by: Anurag Bandyopadhyay <angbpy@gmail.com>
Thanks @karimalzalek! |
Removed the section mentioning panic as behaviour is changed, and added a short error handling paragraph to explain errParse and IsPareseErr helper.