MCPcopy
hub / github.com/wavetermdev/waveterm / GetExitCode

Function GetExitCode

pkg/util/utilfn/utilfn.go:699–708  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

697}
698
699func GetExitCode(err error) int {
700 if err == nil {
701 return 0
702 }
703 if exitErr, ok := err.(*exec.ExitError); ok {
704 return exitErr.ExitCode()
705 } else {
706 return -1
707 }
708}
709
710func GetFirstLine(s string) string {
711 idx := strings.Index(s, "\n")

Callers 1

GetCmdExitCodeFunction · 0.85

Calls 1

ExitCodeMethod · 0.65

Tested by

no test coverage detected