Expected Behaviour
When a command fails I would expect exit code 1 so automation tools can detect an error occurred and stop/react accordingly.
Current Behaviour
Some examples of error handling:
response, err := proxy.InvokeFunction(gateway, functionName, &functionInput, contentType)
if err != nil {
fmt.Println(err)
return
}
if len(services.Functions) > 0 {
pushStack(&services, parallel)
} else {
fmt.Println("You must supply a valid YAML file.")
return
}
if len(services.Functions) > 0 {
pushStack(&services, parallel)
} else {
fmt.Println("You must supply a valid YAML file.")
return
}
Possible Solution
- use cobra.Command.RunE instead of Run
- change the signature of all runCmd functions to return error
- propagate errors with pkg/errors and wrap the original error with meaningful messages
Expected Behaviour
When a command fails I would expect exit code 1 so automation tools can detect an error occurred and stop/react accordingly.
Current Behaviour
Some examples of error handling:
Possible Solution