Update error messages for DNSimple provider (#373)
This commit is contained in:
parent
1293a4a35b
commit
7668fe9274
2 changed files with 4 additions and 4 deletions
|
@ -32,7 +32,7 @@ func NewDNSProvider() (*DNSProvider, error) {
|
|||
// DNSProvider instance configured for dnsimple.
|
||||
func NewDNSProviderCredentials(accessToken, baseUrl string) (*DNSProvider, error) {
|
||||
if accessToken == "" {
|
||||
return nil, fmt.Errorf("DNSimple OAuth token missing")
|
||||
return nil, fmt.Errorf("DNSimple OAuth token is missing")
|
||||
}
|
||||
|
||||
client := dnsimple.NewClient(dnsimple.NewOauthTokenCredentials(accessToken))
|
||||
|
@ -173,7 +173,7 @@ func (c *DNSProvider) getAccountID() (string, error) {
|
|||
}
|
||||
|
||||
if whoamiResponse.Data.Account == nil {
|
||||
return "", fmt.Errorf("DNSimple API returned empty account ID")
|
||||
return "", fmt.Errorf("DNSimple user tokens are not supported, please use an account token.")
|
||||
}
|
||||
|
||||
return strconv.Itoa(whoamiResponse.Data.Account.ID), nil
|
||||
|
|
|
@ -74,7 +74,7 @@ func TestNewDNSProviderInvalidWithMissingOauthToken(t *testing.T) {
|
|||
provider, err := NewDNSProvider()
|
||||
|
||||
assert.Nil(t, provider)
|
||||
assert.EqualError(t, err, "DNSimple OAuth token missing")
|
||||
assert.EqualError(t, err, "DNSimple OAuth token is missing")
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -102,7 +102,7 @@ func TestNewDNSProviderCredentialsInvalidWithMissingOauthToken(t *testing.T) {
|
|||
provider, err := NewDNSProviderCredentials("", "")
|
||||
|
||||
assert.Nil(t, provider)
|
||||
assert.EqualError(t, err, "DNSimple OAuth token missing")
|
||||
assert.EqualError(t, err, "DNSimple OAuth token is missing")
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue