mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-19 03:06:45 +02:00
Update error code used for panics
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user