-
Notifications
You must be signed in to change notification settings - Fork 72
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
Recover from panic gracefully #2353
base: main
Are you sure you want to change the base?
Conversation
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.
Could we add an acceptance test by either forcing panic somehow of add special flag to inject it?
We could, but I think it's fine to skip this one. There is no great way to do this since we would have to add a new dummy command or flag just for this. The goal is to have a QOL improvement for customers and make it clear to them that this is a bug on our side. Even if it fails we are not losing out on anything crucial. |
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.
Could you include an acceptance test for the output?
I'd like to see the diff between the current panic output and the new panic output.
@@ -0,0 +1,13 @@ | |||
|
|||
>>> [CLI] panic | |||
The Databricks CLI unexpectedly panicked. |
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.
Panic is a golang-specific term that users are not required to know, perhaps "The Databricks CLI had fatal error"?
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.
Either way works. The next line does direct the user to open an issue on Databricks so they don't need to know what panicking means.
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.
(see inline comments)
Changes
This PR adds a recovery function for panics. This indicates to all users running into a panic that it's a bug and they should report it to Databricks.
Tests
Manually. I added
panic(fmt.Errorf("some error message"))
to theConfigureBundleWithVariables
function which is the fourth entry in the stack trace.Error message: