MCPcopy Create free account
hub / github.com/basecamp/hey-cli / ExitCodeFor

Function ExitCodeFor

internal/output/codes.go:17–42  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

15)
16
17func ExitCodeFor(err error) int {
18 var e *Error
19 if !errors.As(err, &e) {
20 return 1
21 }
22 switch e.Code {
23 case "usage":
24 return ExitUsage
25 case "not_found":
26 return ExitNotFound
27 case "auth":
28 return ExitAuth
29 case "forbidden":
30 return ExitForbidden
31 case "rate_limit":
32 return ExitRateLimit
33 case "network":
34 return ExitNetwork
35 case "api":
36 return ExitAPI
37 case "ambiguous":
38 return ExitAmbiguous
39 default:
40 return 1
41 }
42}

Callers 2

ExecuteFunction · 0.92
TestExitCodeForFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestExitCodeForFunction · 0.68