Skip to content

Commit

Permalink
added additional response logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dgulinobw committed Feb 13, 2023
1 parent 98d31a7 commit 31b62c3
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions dog-import/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ func link_export(output_dir string, environment string) {

res, statusCode, err := c.GetLinks(nil)
if err != nil {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}
if statusCode != 200 {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}

tf_w := terraformOutputFile(output_dir, table)
Expand Down Expand Up @@ -108,10 +108,10 @@ func host_export(output_dir string, environment string, host_prefix string) {

res, statusCode, err := c.GetHosts(nil)
if err != nil {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}
if statusCode != 200 {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}

tf_w := terraformOutputFile(output_dir, table)
Expand Down Expand Up @@ -143,10 +143,10 @@ func group_export(output_dir string, environment string) {

res, statusCode, err := c.GetGroups(nil)
if err != nil {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}
if statusCode != 200 {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}

tf_w := terraformOutputFile(output_dir, table)
Expand Down Expand Up @@ -190,10 +190,10 @@ func service_export(output_dir string, environment string) {

res, statusCode, err := c.GetServices(nil)
if err != nil {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}
if statusCode != 200 {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}

tf_w := terraformOutputFile(output_dir, table)
Expand Down Expand Up @@ -233,10 +233,10 @@ func zone_export(output_dir string, environment string) {

res, statusCode, err := c.GetZones(nil)
if err != nil {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}
if statusCode != 200 {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}

tf_w := terraformOutputFile(output_dir, table)
Expand Down Expand Up @@ -265,10 +265,10 @@ func profile_export(output_dir string, environment string) {

res, statusCode, err := c.GetProfiles(nil)
if err != nil {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}
if statusCode != 200 {
log.Fatalln(err)
log.Fatalln("res: ", res, "statusCode: ", statusCode, "err: ", err)
}

tf_w := terraformOutputFile(output_dir, table)
Expand Down

0 comments on commit 31b62c3

Please sign in to comment.