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

rom8726 / floxy / 19003131425

01 Nov 2025 09:50PM UTC coverage: 43.3% (+0.02%) from 43.279%
19003131425

push

github

rom8726
Process panics in handlers.

8 of 13 new or added lines in 2 files covered. (61.54%)

3771 of 8709 relevant lines covered (43.3%)

39.03 hits per line

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

58.33
/step_handler.go
1
package floxy
2

3
import (
4
        "context"
5
        "encoding/json"
6
        "fmt"
7
        "runtime/debug"
8
)
9

10
type StepHandler interface {
11
        Execute(ctx context.Context, stepCtx StepContext, input json.RawMessage) (json.RawMessage, error)
12
        Name() string
13
}
14

15
type StepContext interface {
16
        InstanceID() int64
17
        StepName() string
18
        IdempotencyKey() string
19
        RetryCount() int
20
        CloneData() map[string]any
21
        GetVariable(key string) (any, bool)
22
        GetVariableAsString(key string) (string, bool)
23
}
24

25
type noPanicStepHandler struct {
26
        handler StepHandler
27
}
28

29
func wrapProcessPanicHandler(handler StepHandler) *noPanicStepHandler {
86✔
30
        return &noPanicStepHandler{handler: handler}
86✔
31
}
86✔
32

33
func (handler *noPanicStepHandler) Execute(
34
        ctx context.Context,
35
        stepCtx StepContext,
36
        input json.RawMessage,
37
) (out json.RawMessage, errRes error) {
156✔
38
        defer func() {
312✔
39
                if r := recover(); r != nil {
156✔
NEW
40
                        errRes = fmt.Errorf("panic in handler %q: %v\n%s", handler.Name(), r, debug.Stack())
×
NEW
41
                }
×
42
        }()
43

44
        return handler.handler.Execute(ctx, stepCtx, input)
156✔
45
}
46

NEW
47
func (handler *noPanicStepHandler) Name() string {
×
NEW
48
        return handler.handler.Name()
×
NEW
49
}
×
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

© 2026 Coveralls, Inc