auth

Paddy 2014-08-16 Parent:ceba439a0766 Child:fc5df8e68c7b

14:fe7f358ecbe6 Browse Files

Return NilClientError when updating with nil client. When updateClient is called with a nil client, reaturn a NilClientError.

client.go errors.go

     1.1 --- a/client.go	Wed Aug 13 08:39:07 2014 -0400
     1.2 +++ b/client.go	Sat Aug 16 02:57:49 2014 -0400
     1.3 @@ -24,7 +24,7 @@
     1.4  
     1.5  func updateClient(client *Client, name, logo, redirectURI *string, ctx Context) error {
     1.6  	if client == nil {
     1.7 -		// TODO: return error
     1.8 +		return NilClientError
     1.9  	}
    1.10  	err = ctx.Clients.UpdateClient(client.ID, name, logo, redirectURI)
    1.11  	if err != nil {
     2.1 --- a/errors.go	Wed Aug 13 08:39:07 2014 -0400
     2.2 +++ b/errors.go	Sat Aug 16 02:57:49 2014 -0400
     2.3 @@ -23,6 +23,7 @@
     2.4  	AuthorizationNotFoundError = errors.New("Authorization not found.")
     2.5  	ProfileNotFoundError       = errors.New("Profile not found.")
     2.6  	TokenNotFoundError         = errors.New("Token not found.")
     2.7 +	NilClientError             = errors.New("Client was nil.")
     2.8  )
     2.9  
    2.10  type URIFormatError string