summaryrefslogtreecommitdiffhomepage
path: root/control/controlknobs/controlknobs.go
diff options
context:
space:
mode:
authorPaul Scott <paul@tailscale.com>2024-07-16 11:32:43 +0100
committerPaul Scott <408401+icio@users.noreply.github.com>2024-07-18 15:41:04 +0100
commitd97cddd8761d780ac8976225c9b62f8bc83f8eb2 (patch)
tree0d1b9589558f6de26eadb460c83c8f33e3f52bcd /control/controlknobs/controlknobs.go
parentf77821fd63d1dd75dea2622b6394b723f995a01d (diff)
downloadtailscale-d97cddd8761d780ac8976225c9b62f8bc83f8eb2.tar.xz
tailscale-d97cddd8761d780ac8976225c9b62f8bc83f8eb2.zip
tsweb: swallow panics
With this change, the error handling and request logging are all done in defers after calling inner.ServeHTTP. This ensures that any recovered values which we want to re-panic with retain a useful stacktrace. However, we now only re-panic from errorHandler when there's no outside logHandler. Which if you're using StdHandler there always is. We prefer this to ensure that we are able to write a 500 Internal Server Error to the client. If a panic hits http.Server then the response is not sent back. Updates #12784 Signed-off-by: Paul Scott <paul@tailscale.com>
Diffstat (limited to 'control/controlknobs/controlknobs.go')
0 files changed, 0 insertions, 0 deletions