auth

Paddy 2014-10-15 Parent:3a6a65ed380c Child:0f80a3e391b8

49:73a9f7a6af54 Go to Latest

auth/client.go

Update error strings, add ErrNo*Store errors. Update error strings to consistently begin with a lowercase letter and end without punctuation, as per the Go style guide. See https://code.google.com/p/go-wiki/wiki/CodeReviewComments#Error_Strings For each type of Store, add an ErrNo*Store error (e.g., ErrNoTokenStore) variable, to prepare for our Context type, which will throw these errors when a Store is used without being set.

History
     1.1 --- a/client.go	Mon Sep 29 00:58:42 2014 -0400
     1.2 +++ b/client.go	Wed Oct 15 23:22:19 2014 -0400
     1.3 @@ -3,23 +3,24 @@
     1.4  import (
     1.5  	"errors"
     1.6  	"net/url"
     1.7 +	"strings"
     1.8  	"time"
     1.9  
    1.10  	"code.secondbit.org/uuid"
    1.11 -	"strings"
    1.12  )
    1.13  
    1.14  var (
    1.15 -	ErrClientNotFound      = errors.New("Client not found in ClientStore.")
    1.16 -	ErrClientAlreadyExists = errors.New("Client already exists in ClientStore.")
    1.17 +	ErrNoClientStore       = errors.New("no ClientStore was specified for the Context")
    1.18 +	ErrClientNotFound      = errors.New("client not found in ClientStore")
    1.19 +	ErrClientAlreadyExists = errors.New("client already exists in ClientStore")
    1.20  
    1.21 -	ErrEmptyChange          = errors.New("Change must have at least one change in it.")
    1.22 -	ErrClientNameTooShort   = errors.New("Client name must be at least 2 characters.")
    1.23 -	ErrClientNameTooLong    = errors.New("Client name must be at most 32 characters.")
    1.24 -	ErrClientLogoTooLong    = errors.New("Client logo must be at most 1024 characters.")
    1.25 -	ErrClientLogoNotURL     = errors.New("Client logo must be a valid absolute URL.")
    1.26 -	ErrClientWebsiteTooLong = errors.New("Client website must be at most 1024 characters.")
    1.27 -	ErrClientWebsiteNotURL  = errors.New("Client website must be a valid absolute URL.")
    1.28 +	ErrEmptyChange          = errors.New("change must have at least one change in it")
    1.29 +	ErrClientNameTooShort   = errors.New("client name must be at least 2 characters")
    1.30 +	ErrClientNameTooLong    = errors.New("client name must be at most 32 characters")
    1.31 +	ErrClientLogoTooLong    = errors.New("client logo must be at most 1024 characters")
    1.32 +	ErrClientLogoNotURL     = errors.New("client logo must be a valid absolute URL")
    1.33 +	ErrClientWebsiteTooLong = errors.New("client website must be at most 1024 characters")
    1.34 +	ErrClientWebsiteNotURL  = errors.New("client website must be a valid absolute URL")
    1.35  )
    1.36  
    1.37  // Client represents a client that grants access