#9152 bug: Catalog file contents should be displayed when it's invalid
Issue created by
edgarrmondragon
### Meltano Version
3.7.0a4
### Python Version
NA
### Bug scope
CLI (options, error messages, logging, etc.)
### Operating System
NA
### Description
When catalog discovery fails because the catalog is invalid JSON, the contents of the file should be displayed to the user so it's easier to identify the problem.
meltano/src/meltano/core/plugin/singer/tap.py
Lines 428 to 436 in</meltano/meltano/commit/7e05ed031c68e97434d1e2c98ada91f33bdd1e04|7e05ed0>
| try: |
| ------------------------------------------------------------------ |
| async with await anyio.open_file(catalog_path) as catalog_file: |
| catalog = json.loads(await catalog_file.read()) |
| Draft4Validator.check_schema(catalog) |
| except Exception as err: |
| catalog_path.unlink() |
| raise PluginExecutionError( |
| f"Catalog discovery failed: invalid catalog: {err}", # noqa: EM102 |
| ) from err |
### Code
plugins: {}
### Link to Slack/Linen
https://meltano.slack.com/archives/C068YBV6KEK/p1742742404845179
meltano/meltano