Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve download images logs #466

Merged
merged 4 commits into from
Sep 27, 2023
Merged

Improve download images logs #466

merged 4 commits into from
Sep 27, 2023

Conversation

PhilippeMoussalli
Copy link
Contributor

Some of the exception caught by the download images component returned an empty string since the exception object does not always have a string representation .

Example:

except Exception as e:
    logger.warning(f"Skipping {url}: {e)")

returns:

Skipping https://2.gravatar.com/avatar/2d7699b189a0d1e40a506aa3b8cad2dc?s=48&d=identicon&r=G: 

This makes it difficult to trace back why a url was skipped. Changing to repr(e) seems to fix it since most exeception objects seem to have a printable representational string (at least the httpx ones)

@PhilippeMoussalli PhilippeMoussalli merged commit 67c58db into main Sep 27, 2023
5 checks passed
@PhilippeMoussalli PhilippeMoussalli deleted the fix-download-images branch September 27, 2023 12:17
Hakimovich99 pushed a commit that referenced this pull request Oct 16, 2023
Some of the exception caught by the download images component returned
an empty string since the exception object does not always have a
**string representation** .

Example:

```python
except Exception as e:
    logger.warning(f"Skipping {url}: {e)")
```

returns: 

```bash
Skipping https://2.gravatar.com/avatar/2d7699b189a0d1e40a506aa3b8cad2dc?s=48&d=identicon&r=G: 
```

This makes it difficult to trace back why a url was skipped. Changing to
`repr(e)` seems to fix it since most exeception objects seem to have a
**printable representational string** (at least the httpx ones)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants