-
Notifications
You must be signed in to change notification settings - Fork 73
Improve logging when git diff fails
#1490
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
base: develop
Are you sure you want to change the base?
Conversation
Generate changelog in
|
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview💡 Improvements
|
gradle/.DS_Store
Outdated
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.
How did this get added?
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.
yikes, no idea!
| Preconditions.checkState(process.exitValue() == 0, "Expected return code of 0"); | ||
|
|
||
| if (process.exitValue() != 0) { | ||
| throw new IllegalStateException("Expected return code of 0 but got " + process.exitValue() |
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.
I'd use a RuntimeException here instead, IllegalStateException is more to signal an illegal state of the application
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.
Gotcha, i used illegalstate to maintain parity with the previous exception checkState throws, but a runtime exception does make more sense here
Before this PR
When
git difffails, we don't tell the user the exit code and stderr/stdout, meaning the user has to dive in and debug.After this PR
==COMMIT_MSG==
Improve logging when
git difffails==COMMIT_MSG==
Possible downsides?