-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harmonize BeforeError handling #1117
Conversation
Thanks for following up! This is great. I did a quick audit of the code base, it looks like there's one more Lines 150 to 157 in 4bb97e0
Would you mind dropping the call to |
Yup, my bad should have seen this one. Done ! |
Btw is it wanted that this logic is uncoupled and not centralised? IMHO since the BeforeError handling is common (and this is wanted) between the 3 occurrences, I would have centralise the logic somewhere |
There's a lot of logic like this that I'd like to see centralized. There are subtle reasons why it's not that way right now, such as repeated logic for different types or handling named return parameters. Not that it can't be improved—it absolutely can be. But it's not necessarily easy. |
What type of PR is this?
What this PR does / why we need it:
The error handling using BeforeFunc is now harmonized between App#RunContext, App#RunAsSubcommand & Command#Run.
Which issue(s) this PR fixes:
Fixes #1081
Release Notes
(REQUIRED)