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

Print full error message for GenericError #272

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Feb 15, 2025

What I am changing

  • Make BareRedirect, Server, Client, Reqwest error message more informative

How I did it

  • Change format!("{err:#?}") to err.to_string()

How you can test it

  • Run uv run maturin develop -m obstore/Cargo.toml, and then try opening some file object that requires setting AWS_REGION or other environment variables
    import obstore as obs
    
    store = obs.store.from_url(url="s3://<bucket-name>")
    response = obs.get(
        store=store, path="abcdefghijklmnopqrs/1234567890.jpeg"
    )
  • Should get full error messages like:
    GenericError: Generic S3 error: Received redirect without LOCATION, this normally indicates an incorrectly configured region
    GenericError: Generic S3 error: Error after 10 retries in 12.3456789s, max_retries:10, retry_timeout:180s, source:error sending request for url (http://169.254.169.254/latest/api/token)
    

Related Issues

@weiji14
Copy link
Member Author

weiji14 commented Feb 15, 2025

Let me know if you'd like some unit tests for this (and where to add them).

@kylebarron
Copy link
Member

This seems fine. I'm not sure if we need tests for this, or, if we do, what the best way to have tests is.

@weiji14 weiji14 marked this pull request as ready for review February 19, 2025 23:24
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.

Improve error printing
2 participants