mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-31 16:23:44 +00:00
don't try to http.Error after trying to encode to w
This commit is contained in:
parent
af2fd8bd7e
commit
4175e2e21d
@ -165,7 +165,7 @@ func (c *Consensus) makeCommandMux() *http.ServeMux {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := json.NewEncoder(w).Encode(result); err != nil {
|
if err := json.NewEncoder(w).Encode(result); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
log.Printf("error encoding execute command result: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -69,7 +69,6 @@ func (m *monitor) handleFullStatus(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
if err := json.NewEncoder(w).Encode(s); err != nil {
|
if err := json.NewEncoder(w).Encode(s); err != nil {
|
||||||
log.Printf("monitor: error encoding full status: %v", err)
|
log.Printf("monitor: error encoding full status: %v", err)
|
||||||
http.Error(w, "", http.StatusInternalServerError)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,7 +120,6 @@ func (m *monitor) handleNetmap(w http.ResponseWriter, r *http.Request) {
|
|||||||
encoder.SetIndent("", "\t")
|
encoder.SetIndent("", "\t")
|
||||||
if err := encoder.Encode(n); err != nil {
|
if err := encoder.Encode(n); err != nil {
|
||||||
log.Printf("monitor: error encoding netmap: %v", err)
|
log.Printf("monitor: error encoding netmap: %v", err)
|
||||||
http.Error(w, "", http.StatusInternalServerError)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user