MCPcopy
hub / github.com/smallstep/cli / panicHandler

Function panicHandler

internal/cmd/root.go:156–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154}
155
156func panicHandler() {
157 if r := recover(); r != nil {
158 if os.Getenv("STEPDEBUG") == "1" {
159 fmt.Fprintf(os.Stderr, "%s\n", step.Version())
160 fmt.Fprintf(os.Stderr, "Release Date: %s\n\n", step.ReleaseDate())
161 panic(r)
162 }
163
164 fmt.Fprintln(os.Stderr, "Something unexpected happened.")
165 fmt.Fprintln(os.Stderr, "If you want to help us debug the problem, please run:")
166 fmt.Fprintf(os.Stderr, "STEPDEBUG=1 %q\n", strings.Join(os.Args, " ")) // #nosec G705 -- terminal output
167 fmt.Fprintln(os.Stderr, "and send the output to info@smallstep.com")
168 os.Exit(2)
169 }
170}
171
172func flagValue(f cli.Flag) reflect.Value {
173 fv := reflect.ValueOf(f)

Callers 1

runFunction · 0.85

Calls 1

VersionMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…