mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 03:47:54 +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() {
|
||||
if r := recover(); r != nil {
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user