Merge pull request #1117 from creekorful/harmonize-error-handling

Harmonize BeforeError handling
This commit is contained in:
Robert Liebowitz
2020-04-28 06:33:12 -04:00
committed by GitHub
2 changed files with 0 additions and 3 deletions

2
app.go
View File

@@ -292,8 +292,6 @@ func (a *App) RunContext(ctx context.Context, arguments []string) (err error) {
if a.Before != nil {
beforeErr := a.Before(context)
if beforeErr != nil {
_, _ = fmt.Fprintf(a.Writer, "%v\n\n", beforeErr)
_ = ShowAppHelp(context)
a.handleExitCoder(context, beforeErr)
err = beforeErr
return err

View File

@@ -150,7 +150,6 @@ func (c *Command) Run(ctx *Context) (err error) {
if c.Before != nil {
err = c.Before(context)
if err != nil {
_ = ShowCommandHelp(context, c.Name)
context.App.handleExitCoder(context, err)
return err
}