-
Notifications
You must be signed in to change notification settings - Fork 25
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
New Error and cleanup function for CreateRunnableCmd failures #135
New Error and cleanup function for CreateRunnableCmd failures #135
Conversation
…Cmd failures Based on the conv in suborbital#119, we want to delete the output dir of `sudo create runnable` for any failure that occurs in `CreateRunnableCmd`. `CreateRunnableError`s `Error` will also act as a cleanup function for these failures. atm, it's only deleting the output dir. Ideally, cobra.Command would have a error callback feature... maybe we'll get one for Xmas. spf13/cobra#914
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small suggestions. Let me know if you have any questions.
Co-authored-by: Jagger De Leo <[email protected]>
…errors for CreateRunnableCmd() failures Based on pr feedback suborbital#135 (comment) Co-Authored-By: Jagger De Leo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks!
Closes #119 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
PR for #119
Based on the conv in #119, we want to delete the output dir of
sudo create runnable
for any failure that occurs inCreateRunnableCmd
.Replication steps:
subo create runnable foobar --lang somethingnotsupported
CreateRunnableError
sError
will also act as a cleanup function for these failures. atm, it's only deleting the output dir.Ideally, cobra.Command would have a error callback feature when RunE fails... maybe we'll get one for Xmas. spf13/cobra#914
Off topic, I wish cobra.Command had a error callback for each of their run
E
functions (RunE
,PreRunE
,PostRunE
,PersistentPreRunE
,PersistentPostRunE
). They have a callback for when flag parsing fails. I'll create an issue ticket requesting this if it doesn't already exist.