Updated command.go to use App handleExitCoder
This commit is contained in:
parent
ceee6408d5
commit
9d61cbad02
@ -167,7 +167,7 @@ func (c Command) Run(ctx *Context) (err error) {
|
||||
if err != nil {
|
||||
if c.OnUsageError != nil {
|
||||
err := c.OnUsageError(context, err, false)
|
||||
HandleExitCoder(err)
|
||||
context.App.handleExitCoder(err)
|
||||
return err
|
||||
}
|
||||
fmt.Fprintln(context.App.Writer, "Incorrect Usage:", err.Error())
|
||||
@ -184,7 +184,7 @@ func (c Command) Run(ctx *Context) (err error) {
|
||||
defer func() {
|
||||
afterErr := c.After(context)
|
||||
if afterErr != nil {
|
||||
HandleExitCoder(err)
|
||||
ctx.App.handleExitCoder(err)
|
||||
if err != nil {
|
||||
err = NewMultiError(err, afterErr)
|
||||
} else {
|
||||
@ -198,7 +198,7 @@ func (c Command) Run(ctx *Context) (err error) {
|
||||
err = c.Before(context)
|
||||
if err != nil {
|
||||
ShowCommandHelp(context, c.Name)
|
||||
HandleExitCoder(err)
|
||||
context.App.handleExitCoder(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -210,7 +210,7 @@ func (c Command) Run(ctx *Context) (err error) {
|
||||
err = HandleAction(c.Action, context)
|
||||
|
||||
if err != nil {
|
||||
HandleExitCoder(err)
|
||||
ctx.App.handleExitCoder(err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user