mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-21 06:01:42 +00:00
tsweb: don't panic if we get a tsweb.Error with no embedded error.
It's technically weird to return a tsweb.Error with no child err, but it's a sensible thing to want to do, and we shouldn't panic if it happens. Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:
parent
2f8719741e
commit
2c2dff9559
@ -219,7 +219,9 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
case hErrOK:
|
case hErrOK:
|
||||||
// Handler asked us to send an error. Do so, if we haven't
|
// Handler asked us to send an error. Do so, if we haven't
|
||||||
// already sent a response.
|
// already sent a response.
|
||||||
|
if hErr.Err != nil {
|
||||||
msg.Err = hErr.Err.Error()
|
msg.Err = hErr.Err.Error()
|
||||||
|
}
|
||||||
if lw.code != 0 {
|
if lw.code != 0 {
|
||||||
h.logf("[unexpected] handler returned HTTPError %v, but already sent a response with code %d", hErr, lw.code)
|
h.logf("[unexpected] handler returned HTTPError %v, but already sent a response with code %d", hErr, lw.code)
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user