• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bavix / gripmock / 17066567963

19 Aug 2025 10:15AM UTC coverage: 52.632% (-0.9%) from 53.531%
17066567963

push

github

web-flow
Merge pull request #653 from bavix/652-field-outputheaders-not-being-sent-as-trailers-if-outputcode-0

Fix Trailers

78 of 190 new or added lines in 8 files covered. (41.05%)

7 existing lines in 1 file now uncovered.

1590 of 3021 relevant lines covered (52.63%)

30.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/infra/muxmiddleware/panic_recovery.go
1
package muxmiddleware
2

3
import (
4
        "net/http"
5

6
        "github.com/rs/zerolog"
7
)
8

9
// PanicRecoveryMiddleware recovers from panics in HTTP handlers.
NEW
10
func PanicRecoveryMiddleware(next http.Handler) http.Handler {
×
NEW
11
        return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
×
NEW
12
                ctx := r.Context()
×
NEW
13

×
NEW
14
                defer func() {
×
NEW
15
                        if panicValue := recover(); panicValue != nil {
×
NEW
16
                                zerolog.Ctx(ctx).
×
NEW
17
                                        Error().
×
NEW
18
                                        Interface("panic", panicValue).
×
NEW
19
                                        Str("method", r.Method).
×
NEW
20
                                        Str("path", r.URL.Path).
×
NEW
21
                                        Msg("Panic recovered in HTTP handler")
×
NEW
22

×
NEW
23
                                // Return 500 Internal Server Error
×
NEW
24
                                http.Error(w, "Internal Server Error", http.StatusInternalServerError)
×
NEW
25
                        }
×
26
                }()
27

NEW
28
                next.ServeHTTP(w, r)
×
29
        })
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc