Skip to content

Commit

Permalink
log panic error (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
realityone committed Apr 8, 2024
1 parent 9f4b128 commit b5b7d89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.WriteHeader(http.StatusBadGateway)
buf := make([]byte, 64<<10) //nolint:gomnd
n := runtime.Stack(buf, false)
log.Errorf("panic recovered: %s", buf[:n])
fmt.Fprintf(os.Stderr, "panic recovered: %s\n", buf[:n])
log.Errorf("panic recovered: %+v\n%s", err, buf[:n])
fmt.Fprintf(os.Stderr, "panic recovered: %+v\n%s\n", err, buf[:n])
}
}()
p.router.Load().(router.Router).ServeHTTP(w, req)
Expand Down

0 comments on commit b5b7d89

Please sign in to comment.