Clear usage errors when incorrect auth packages are applied. #1559
Unanswered
tomchristie
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Prompted by this issue... #1558
It's a fairly easy user error for users to attempt to apply a
requests
auth package to anhttpx
client. Understandable that folks might try to do that. Question is, could this be something worth handling with clearer error messaging (or not)?Note that the traceback on that issue only fails as a result of duck typing. It'd be clearer if we raised a
TypeError
at the point an invalid auth is applied to the client...Of course there's a wider question that this raises regarding type checking on our interfaces as a whole, when to provide for strict
TypeError
raising, and when to just suck it up and expect our users to use the package as intended. Trade off being that adding stricter type checking brings a little extra gumpf into our codebase, which makes it a little more complex for users digging under the hood perhaps?Beta Was this translation helpful? Give feedback.
All reactions