We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there a reason why this library doesn't provide the "go way" of error handling ?
resp := grequests.Get("http://httpbin.org/xml", nil) if resp.Error != nil { log.Fatalln("Unable to make request", resp.Error) }
VS
resp, err := grequests.Get("http://httpbin.org/xml", nil) if err != nil { log.Fatalln("Unable to make request", err) }
The text was updated successfully, but these errors were encountered:
The standard library uses both methods. The second is more common, but Scanner.Scan() in the bufio package does it the first way.
You read each line in the file, and at the end you check if your scanner's .Err is something you care about.
.Err
Sorry, something went wrong.
The resp.Error pattern is a remnant of the asynchronous nature of the library (up until a few days ago all functions returned a channel).
resp.Error
I do intend to make to change the API to the more "standard" way
Fixed in #0.2
No branches or pull requests
Is there a reason why this library doesn't provide the "go way" of error handling ?
VS
The text was updated successfully, but these errors were encountered: