mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-16 05:18:38 +01:00
fix (recover): recover from possible panic
This commit is contained in:
parent
7a9f94ce6d
commit
0748e56092
1 changed files with 9 additions and 1 deletions
|
|
@ -105,7 +105,15 @@ func Logger(ctx App, res http.ResponseWriter, req *http.Request) {
|
|||
}
|
||||
return GenerateID(&ctx)
|
||||
}(),
|
||||
RequestID: res.Header().Get("X-Request-ID"),
|
||||
RequestID: func() string {
|
||||
defer func() string {
|
||||
if r := recover(); r != nil {
|
||||
Log.Debug("middleware::index get header '%s'", r)
|
||||
}
|
||||
return "null"
|
||||
}()
|
||||
return res.Header().Get("X-Request-ID")
|
||||
}(),
|
||||
}
|
||||
if Config.Get("log.telemetry").Bool() {
|
||||
telemetry.Record(point)
|
||||
|
|
|
|||
Loading…
Reference in a new issue