From e29561105372765160c5dacf133ba5a663863812 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Thu, 18 Jul 2024 10:29:23 -0600 Subject: [PATCH] feat: add more info to CLI error message --- CHANGELOG.md | 1 + src/stac_asset/_cli.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdf2577..2d5b3e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - `--http-timeout` option to the CLI ([#196](https://github.com/stac-utils/stac-asset/pull/196)) +- More info to CLI error reporting ([#200](https://github.com/stac-utils/stac-asset/pull/200)) ### Fixed diff --git a/src/stac_asset/_cli.py b/src/stac_asset/_cli.py index 6b80e75..7b86cf3 100644 --- a/src/stac_asset/_cli.py +++ b/src/stac_asset/_cli.py @@ -370,7 +370,10 @@ async def report_progress(messages: Optional[MessageQueue]) -> None: name = f"{owners[message.key]}[{message.key}]" else: name = f"[{message.key}]" - progress_bar.write(f"ERROR: {name} - {message.error}", file=sys.stderr) + progress_bar.write( + f"ERROR: {name} - {type(message.error).__name__}: {message.error}", + file=sys.stderr, + ) elif isinstance(message, WriteChunk): n += message.size progress_bar.update(message.size)