From 8f0a8f432e840a7eb028bd7dd41e9e78aa584bc3 Mon Sep 17 00:00:00 2001 From: michaelfmnk Date: Wed, 7 Aug 2024 14:45:01 +0200 Subject: [PATCH] CAPI-269: DNS Records improvements --- cloudconnexa/dns_records.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cloudconnexa/dns_records.go b/cloudconnexa/dns_records.go index 11237fd..1eaefa8 100644 --- a/cloudconnexa/dns_records.go +++ b/cloudconnexa/dns_records.go @@ -7,6 +7,10 @@ import ( "net/http" ) +var ( + ErrDnsRecordNotFound = fmt.Errorf("dns record not found") +) + type DnsRecord struct { Id string `json:"id"` Domain string `json:"domain"` @@ -68,7 +72,7 @@ func (c *DNSRecordsService) GetDnsRecord(recordId string) (*DnsRecord, error) { } page++ } - return nil, fmt.Errorf("DNS record with ID %s not found", recordId) + return nil, ErrDnsRecordNotFound } func (c *DNSRecordsService) Create(record DnsRecord) (*DnsRecord, error) {