Skip to content

Commit

Permalink
fix resp
Browse files Browse the repository at this point in the history
  • Loading branch information
twz915 committed Jan 7, 2021
1 parent 88dde91 commit be19831
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions primitive/nsresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,15 @@ func (h *HttpResolver) Description() string {

func (h *HttpResolver) get() []string {
resp, err := h.cli.Get(h.domain)
if err != nil || resp.StatusCode != 200 {
rlog.Error("name server http fetch failed", map[string]interface{}{
if err != nil || resp == nil || resp.StatusCode != 200 {
data := map[string]interface{}{
"NameServerDomain": h.domain,
"StatusCode": resp.StatusCode,
"err": err,
})
}
if resp != nil {
data["StatusCode"] = resp.StatusCode
}
rlog.Error("name server http fetch failed", data)
return nil
}

Expand Down

0 comments on commit be19831

Please sign in to comment.