@@ -2,12 +2,12 @@ package main
2
2
3
3
import (
4
4
"fmt"
5
+ "os"
5
6
"strconv"
6
7
"strings"
7
8
8
9
"github.com/cloudflare/cloudflare-go"
9
10
"github.com/codegangsta/cli"
10
- "github.com/pkg/errors"
11
11
)
12
12
13
13
func formatDNSRecord (record cloudflare.DNSRecord ) table {
@@ -53,7 +53,8 @@ func dnsCreate(c *cli.Context) {
53
53
}
54
54
resp , err := api .CreateDNSRecord (zoneID , record )
55
55
if err != nil {
56
- errors .Wrap (err , "error creating DNS record" )
56
+ fmt .Fprintln (os .Stderr , "Error creating DNS record: " , err )
57
+ return
57
58
}
58
59
59
60
output := []table {
@@ -81,7 +82,7 @@ func dnsCreateOrUpdate(c *cli.Context) {
81
82
82
83
zoneID , err := api .ZoneIDByName (zone )
83
84
if err != nil {
84
- fmt .Println ( err )
85
+ fmt .Fprintln ( os . Stderr , "Error updating DNS record: " , err )
85
86
return
86
87
}
87
88
@@ -91,7 +92,7 @@ func dnsCreateOrUpdate(c *cli.Context) {
91
92
}
92
93
records , err := api .DNSRecords (zoneID , rr )
93
94
if err != nil {
94
- fmt .Println ( err )
95
+ fmt .Fprintln ( os . Stderr , "Error fetching DNS records: " , err )
95
96
return
96
97
}
97
98
@@ -165,7 +166,8 @@ func dnsUpdate(c *cli.Context) {
165
166
}
166
167
err = api .UpdateDNSRecord (zoneID , recordID , record )
167
168
if err != nil {
168
- fmt .Println ("Error updating DNS record:" , err )
169
+ fmt .Fprintln (os .Stderr , "Error updating DNS record: " , err )
170
+ return
169
171
}
170
172
}
171
173
@@ -189,6 +191,7 @@ func dnsDelete(c *cli.Context) {
189
191
190
192
err = api .DeleteDNSRecord (zoneID , recordID )
191
193
if err != nil {
192
- fmt .Println ("Error deleting DNS record:" , err )
194
+ fmt .Fprintln (os .Stderr , "Error deleting DNS record: " , err )
195
+ return
193
196
}
194
197
}
0 commit comments