MCPcopy
hub / github.com/mislav/hub / handleError

Function handleError

main.go:22–43  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

20}
21
22func handleError(err error) int {
23 if err == nil {
24 return 0
25 }
26
27 switch e := err.(type) {
28 case *exec.ExitError:
29 if status, ok := e.Sys().(syscall.WaitStatus); ok {
30 return status.ExitStatus()
31 } else {
32 return 1
33 }
34 case *commands.ErrHelp:
35 ui.Println(err)
36 return 0
37 default:
38 if errString := err.Error(); errString != "" {
39 ui.Errorln(err)
40 }
41 return 1
42 }
43}

Callers 1

mainFunction · 0.85

Calls 3

PrintlnFunction · 0.92
ErrorlnFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…