When I call client.Do
method, how would I be notified for errors like 429 response code (aka too many requests). Should I expect to get a response object back with a status code 429 or will I get an error with just the message “too many requests”?
I am seeing the latter and what I need is to be able to get status code for all errors (server/dial/tcp/dns/etc.) and successes and only in some cases I can get the actual code in case of errors. Is there anyway to get all response codes irrespective of the error type - the error message seems to reflect the details but would still like to get the code if possible.