mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-09 22:55:17 +08:00
ns1: workaround an issue with ns1 API (#1671)
NS1 api returns a different message these days, which breaks error handling. Until a fix is merged upstream, work around the issue by attempting to match the stray error ourselves. relates to #1667.
This commit is contained in:
parent
eba4155cb9
commit
dbfd2b7cb4
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@ package ns1
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
@ -61,6 +62,12 @@ func (n *nsone) EnsureDomainExists(domain string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
newZoneExistsError := errors.New("invalid: FQDN already exists in the view")
|
||||
if errors.As(err, &newZoneExistsError) {
|
||||
// XXX: FIX: This is an ugly workaround for https://github.com/ns1/ns1-go/issues/163. Remove when resolved.
|
||||
return nil
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue