-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Description
I've noticed that all CLI utility errors are silent. For example, if you try to create a migration, but you did something wrong, there will be no output and no files created.
I tracked this down to how the CLI is run. You do:
newApp().Run(os.Args)
But according to the docs for the cli lib version you're using, errors returned by cli actions must implement cli.ExitCoder
to be printed, but the errors returned by errors.New
definitely don't.
To fix, you can either:
- Switch to using the (technically deprecated)
RunAndExitOnError
function - Print the error returned by
Run
and exit with a non-zero code - Implement
cli.ExitCoder
for the errors (or wrap just as they escape the action function)
Out of those, I'd probably pick the first, since you've pinned the urfave cli library at v1 anyway.
If you'd prefer, I can send a PR, but it's a pretty small change that you could probably make more quickly yourselves. 😄
jBugman and zakkor
Metadata
Metadata
Assignees
Labels
No labels