Skip to content

Conversation

@Bibo-Joshi
Copy link
Member

Closes #3778 as suggested by Noam in the dev chat.

Tests for {Base, HTTPX}Request not extended yet.

@Bibo-Joshi Bibo-Joshi marked this pull request as ready for review July 6, 2023 18:55
Copy link
Member

@lemontree210 lemontree210 left a comment

Choose a reason for hiding this comment

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

I have a general question: it was my understanding that if we raise some exception from another exception, we don't need to specify any cause explicitly. I think that's the way it's formulated in the docs and I personally have found raise ... from ... quite informative on its own.

If a user wants to check the cause explicitly, I think they can use .__cause__ (as per the same docs).

So what am I missing here? :)

@Bibo-Joshi
Copy link
Member Author

Huh. I really just didn't know that. Makes sense that raise … from has to be stored somehow, but I wasn't aware that this is documented. A bit weird though that __cause__ is not documented as proper attribute 🤔 Moreorever, that attribute apparently is not pickled: python/cpython#73652.
I'd be okay with the non-pickable thing if we agree that __cause__ can bes considered to be public python API …

@Bibo-Joshi Bibo-Joshi changed the title Add NetworkError.cause Test and Document `Exception. Jul 16, 2023
@Bibo-Joshi Bibo-Joshi changed the title Test and Document `Exception. Test and Document Exception.__cause__ on NetworkError Jul 16, 2023
Copy link
Member

@lemontree210 lemontree210 left a comment

Choose a reason for hiding this comment

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

Some punctuation nitpicks in docstring, maybe not even justified :)

Co-authored-by: Dmitry Kolomatskiy <58207913+lemontree210@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
@Bibo-Joshi Bibo-Joshi merged commit 7226aae into master Jul 18, 2023
@Bibo-Joshi Bibo-Joshi deleted the timeout-subclasses branch July 18, 2023 10:02
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 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.

[FEATURE] More fine grained network exceptions

4 participants