Skip to content

Conversation

@Bibo-Joshi
Copy link
Member

@Bibo-Joshi Bibo-Joshi commented Jan 14, 2023

Improves the error message for NetworkErrors raised in HTTPXRequest to also include the error type name. This is especially useful if the error raised by httpx has an empty error message.

Checklist for PRs

  • Added .. versionadded:: version, .. versionchanged:: version or .. deprecated:: version to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
  • Created new or adapted existing unit tests
  • Documented code changes according to the CSI standard
  • Added myself alphabetically to AUTHORS.rst (optional)
  • Added new classes & modules to the docs and all suitable __all__ s

@harshil21 harshil21 added this to the v20.1 milestone Jan 14, 2023
# HTTPError must come last as its the base httpx exception class
# TODO p4: do something smart here; for now just raise NetworkError
raise NetworkError(f"httpx HTTPError: {err}") from err
raise NetworkError(f"httpx.{err.__class__.__name__}: {err}") from err
Copy link
Member

@Poolitzer Poolitzer Jan 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Id probably write a CSI comment why we have this now

@Bibo-Joshi Bibo-Joshi requested a review from Poolitzer January 15, 2023 11:39
Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Bibo-Joshi Bibo-Joshi merged commit 3dd7d84 into master Jan 15, 2023
@Bibo-Joshi Bibo-Joshi deleted the better-network-errors branch January 15, 2023 12:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2023
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🔌 enhancement pr description: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants