Skip to content

Commit

Permalink
feat: add more info to CLI error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Jul 21, 2024
1 parent 01f7c52 commit e295611
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion src/stac_asset/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e295611

Please sign in to comment.