Support rate limiting

Re: API-67
So cool!  Go Go!


On Tue, Jun 24, 2014 at 9:34 PM, Erica <notifications@github.com> wrote:

> In clever.go:
>
> > @@ -57,6 +57,26 @@ func (err *CleverError) Error() string {
> >  	return fmt.Sprintf("%s (%s)", err.Error, err.Code)
> >  }
> >
> > +type TooManyRequestsError struct {
> > +	Header http.Header
> > +}
> > +
> > +func (err *TooManyRequestsError) Error() string {
> > +	err_string := "Too Many Requests"
> > +	err_props := []string{"Remaining", "Limit", "Reset"}
> > +	for bucket_index := range err.Header["X-Ratelimit-Bucket"] {
> > +		err_string += "\nBucket: " + err.Header["X-Ratelimit-Bucket"][bucket_index]
> > +		for prop_index := range err_props {
> > +			prop := err_props[prop_index]
>
> for prop_index, prop := range err_props { works
>
> same for bucket_index above.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Clever/clever-go/pull/5/files#r14168784>.
>



-- 
Dan Sparks
Software Developer Intern
m | 510-219-4687
w | https://clever.com