Skip to content

Commit

Permalink
Merge pull request #1117 from creekorful/harmonize-error-handling
Browse files Browse the repository at this point in the history
Harmonize BeforeError handling
  • Loading branch information
rliebz committed Apr 28, 2020
2 parents 4bb97e0 + c261e4d commit 464c868
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions app.go
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion command.go
Expand Up @@ -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
}
Expand Down

0 comments on commit 464c868

Please sign in to comment.