Add error surfacing for git cloning errors #4124
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #3167
Description
dbt.exceptions.bad_package_spec()
function to raise the git error and print the content to stdout.Decided to do this in the clone method as that is where it is done for the checkout part.
If git returns the
usage: git
string with the error, I remove it from the message as it is very verbose and probably not helpful.This handled the errors I managed to test fine:
I did not test:
I think this works well enough for surfacing the error messages git provides, without any more contextual error handling.
OSErrors
should be raised as they were before.If you think I should add unit tests for this, let me know which file/test class would be appropriate to add them. I could only find
test_deps.py
which did not seem to test any git functionality.Checklist
CHANGELOG.md
and added information about my change