域名操作错误时显示具体的域名、记录信息等

This commit is contained in:
刘祥超
2022-03-10 17:42:23 +08:00
parent b768bbce5d
commit 8459f106e9
8 changed files with 99 additions and 32 deletions

View File

@@ -150,13 +150,13 @@ func (this *AliDNSProvider) AddRecord(domain string, newRecord *dnstypes.Record)
resp := alidns.CreateAddDomainRecordResponse()
err := this.doAPI(req, resp)
if err != nil {
return err
return this.WrapError(err, domain, newRecord)
}
if resp.IsSuccess() {
return nil
}
return errors.New(resp.GetHttpContentString())
return this.WrapError(errors.New(resp.GetHttpContentString()), domain, newRecord)
}
// UpdateRecord 修改记录
@@ -174,7 +174,7 @@ func (this *AliDNSProvider) UpdateRecord(domain string, record *dnstypes.Record,
resp := alidns.CreateUpdateDomainRecordResponse()
err := this.doAPI(req, resp)
return err
return this.WrapError(err, domain, newRecord)
}
// DeleteRecord 删除记录
@@ -184,7 +184,7 @@ func (this *AliDNSProvider) DeleteRecord(domain string, record *dnstypes.Record)
resp := alidns.CreateDeleteDomainRecordResponse()
err := this.doAPI(req, resp)
return err
return this.WrapError(err, domain, record)
}
// DefaultRoute 默认线路