dbt-coverage
dbt-coverage copied to clipboard
add error handling for manifest.json and catalog.json not found
fixes #41
May need to tweak formatting...add newline in the error message for the manifest one?
Here's test code + output:
>>> from pathlib import Path
>>> import dbt_coverage as dc
>>> dc.load_catalog(Path('asdf'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/brentbrewington/github/dbt-coverage/dbt_coverage/__init__.py", line 510, in load_catalog
raise FileNotFoundError("target/catalog.json not found - "
FileNotFoundError: target/catalog.json not found - before using dbt-coverage, run: dbt docs generate
>>> dc.load_manifest(Path('asdf'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/brentbrewington/github/dbt-coverage/dbt_coverage/__init__.py", line 526, in load_manifest
raise FileNotFoundError(f"target/manifest.json not found - "
FileNotFoundError: target/manifest.json not found - before using dbt-coverage, run a dbt command that creates manifest artifact (see: https://docs.getdbt.com/reference/artifacts/manifest-json)
@mrshu ready for review! see comment above
Looks good to me, thanks @bbrewington!