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

This commit is contained in:
GoEdgeLab
2022-03-10 17:42:23 +08:00
parent adfcdf306e
commit 4084c649a6
8 changed files with 99 additions and 32 deletions

View File

@@ -1331,7 +1331,7 @@ func (this *HuaweiDNSProvider) QueryRecord(domain string, name string, recordTyp
func (this *HuaweiDNSProvider) AddRecord(domain string, newRecord *dnstypes.Record) error {
zoneId, err := this.findZoneIdWithDomain(domain)
if err != nil {
return err
return this.WrapError(err, domain, newRecord)
}
var resp = new(huaweidns.ZonesCreateRecordSetResponse)
@@ -1354,7 +1354,7 @@ func (this *HuaweiDNSProvider) AddRecord(domain string, newRecord *dnstypes.Reco
"ttl": ttl,
}, resp)
if err != nil {
return err
return this.WrapError(err, domain, newRecord)
}
newRecord.Id = resp.Id + "@" + newRecord.Value
@@ -1366,7 +1366,7 @@ func (this *HuaweiDNSProvider) AddRecord(domain string, newRecord *dnstypes.Reco
func (this *HuaweiDNSProvider) UpdateRecord(domain string, record *dnstypes.Record, newRecord *dnstypes.Record) error {
zoneId, err := this.findZoneIdWithDomain(domain)
if err != nil {
return err
return this.WrapError(err, domain, newRecord)
}
var recordId string
@@ -1397,7 +1397,7 @@ func (this *HuaweiDNSProvider) UpdateRecord(domain string, record *dnstypes.Reco
"ttl": ttl,
}, resp)
if err != nil {
return err
return this.WrapError(err, domain, newRecord)
}
return nil
@@ -1407,7 +1407,7 @@ func (this *HuaweiDNSProvider) UpdateRecord(domain string, record *dnstypes.Reco
func (this *HuaweiDNSProvider) DeleteRecord(domain string, record *dnstypes.Record) error {
zoneId, err := this.findZoneIdWithDomain(domain)
if err != nil {
return err
return this.WrapError(err, domain, record)
}
var recordId string
@@ -1421,7 +1421,7 @@ func (this *HuaweiDNSProvider) DeleteRecord(domain string, record *dnstypes.Reco
var resp = new(huaweidns.ZonesDeleteRecordSetResponse)
err = this.doAPI(http.MethodDelete, "/v2.1/zones/"+zoneId+"/recordsets/"+recordId, map[string]string{}, maps.Map{}, resp)
if err != nil {
return err
return this.WrapError(err, domain, record)
}
return nil