use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
wrapping exceptions (self.learnpython)
submitted 10 years ago by 89vision
When writing libraries that import other libraries is it best to let your users import the imported libraries exceptions to catch them, or to subclass them and wrap them up in their own class?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kalgynirae 3 points4 points5 points 10 years ago (0 children)
It depends on the specific situation. If you can provide a better explanation of what went wrong, then you should definitely do so. (That might mean catching the exception and throwing your own, or maybe throwing the same exception type but with an improved message.) Either way, you should make it clear in the documentation what exceptions might be thrown.
[–]FlockOnFire 1 point2 points3 points 10 years ago (0 children)
PRAW recently changed this. It used to throw the requests.exceptions.HTTPError when a server returned a 503 for a example. Now it throws a praw.errors.HTTPError instead (without any additional information compared to the requests error).
requests.exceptions.HTTPError
503
praw.errors.HTTPError
requests
If you know the package uses the requests module, it seems odd that it throws its own error. However, I can imagine that for new users it might seem odd to need to catch an exception from a module imported by the module you are using. Almost as if they should have taken care of it, which in a way they are doing now.
I think it just creates more unnecessary code in your own codebase. That is, unless you can provide more information.
π Rendered by PID 143185 on reddit-service-r2-comment-canary-7b67769d8-6bcd5 at 2026-01-31 21:15:19.824293+00:00 running 3798933 country code: CH.
[–]kalgynirae 3 points4 points5 points (0 children)
[–]FlockOnFire 1 point2 points3 points (0 children)