INNER CODE UNIT · Go

fatalError

openrundev/openrun · cmd/openrun/main.go:249

func fatalError(err error) {
	exitCode := 1
	var exitErr cli.ExitCoder
	if errors.As(err, &exitErr) && exitErr.ExitCode() != 0 {
		exitCode = exitErr.ExitCode()
	}
	if err.Error() != "" {
		fmt.Fprintf(os.Stderr, RED+"error: %s"+RESET+"\n", err) //nolint:errcheck
	}
	system.NotifyServiceFailed(1)
	os.Exit(exitCode)
}

// setUsageErrorHandlers routes flag parsing errors through the app
// ExitErrHandler so they are printed to stderr instead of the urfave/cli
// default of printing usage errors on stdout
func setUsageErrorHandlers(commands []*cli.Command, helpPath string) {
	for _, command := range commands {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…