Skip to content

Commit

Permalink
Fix lint warnings in server.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Wood committed Jun 24, 2015
1 parent 4ddf8b1 commit ef152bc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"time"
)

// Errors returned by the backend when unable to successfully handle payload.
var (
RateExceeded = errors.New("Rate exceeded: slow down!")
PaymentRequired = errors.New("Payment required: expired trial or credit card?")
Unauthorized = errors.New("Unauthorized: bad API key?")
ErrRateExceeded = errors.New("Rate exceeded: slow down!")
ErrPaymentRequired = errors.New("Payment required: expired trial or credit card?")
ErrUnauthorized = errors.New("Unauthorized: bad API key?")
)

func newServerBackend(config *Configuration) *server {
Expand Down Expand Up @@ -63,11 +64,11 @@ func (s *server) Notify(feature Feature, payload Payload) error {
case 201:
return nil
case 429, 503:
return RateExceeded
return ErrRateExceeded
case 402:
return PaymentRequired
return ErrPaymentRequired
case 403:
return Unauthorized
return ErrUnauthorized
default:
return fmt.Errorf(
"request failed status=%d expected=%d",
Expand Down

0 comments on commit ef152bc

Please sign in to comment.