Handle non successfull HTTP responses

This change set equips the RPC client with handling of non successful
HTTP responses. An HTTP response is considered non successful when its
status code is not in the range 200..299

This should enable, for instance, graceful handling of `429` response codes which are sent when the client is throttled. See conformal/btcwallet#107
I don't think HTTP status codes are magic by any means. They're likely some
of the most well known numbers by programmers.
On Jul 3, 2014 5:04 PM, "Dave Collins" <notifications@github.com> wrote:

> In infrastructure.go:
>
> >  		return
> >  	}
> > +
> > +	// Handle non-successfull HTTP responses
> > +	if httpResponse.StatusCode < 200 || httpResponse.StatusCode >= 300 {
>
> This should probably make use of < http.StatusOK || >=
> http.StatusMultipleChoices rather than using magic numbers.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/conformal/btcrpcclient/pull/13/files#r14518311>.
>