mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 11:57:50 +02:00
Update error code used for panics
This commit is contained in:
parent
6539f834c7
commit
f3764b2545
@ -114,7 +114,8 @@ func withPanicGuard() Middleware {
|
|||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
fmt.Printf("panic: %s\n", r)
|
fmt.Printf("panic: %s\n", r)
|
||||||
rw.WriteHeader(http.StatusInternalServerError)
|
// Note that we need to return a 503 error code since that is the error handled by the client in lib.IsOfflineError
|
||||||
|
rw.WriteHeader(http.StatusServiceUnavailable)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
h.ServeHTTP(rw, r)
|
h.ServeHTTP(rw, r)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user