question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to confirm success of subreddit.submit function?

See original GitHub issue

subreddit.submit() returns a Submisison object. How can I check whether the submission was successful or not? None of the fields in a submission indicate this information. thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jarhill0commented, Apr 29, 2019

We can’t accurately document Reddit’s exceptions since Reddit has gone closed-source. All of those end up as APIException, which we have documentation for.

1reaction
jarhill0commented, Apr 29, 2019

@RylanSchaeffer Thank you for expressing your concerns.

In my experience, PRAW’s handling of this is in line with most other Python libraries. That is, for most other libraries, if a function returns without raising an exception, then it has succeeded. This is also true of the Python standard library; for instance, Python’s file handling will throw an exception such as FileNotFoundError under certain conditions, but lack of exceptions indicates success.

In what ways can we make this clearer? I want new users of PRAW to be as comfortable as possible. One option might be to write another tutorial like this one and the other two that we already have. The new tutorial could focus on a few tasks which might fail and how to handle failure. Do you have another suggestion?

Thanks for your input!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Subreddit Analytics: The Top Six Tools - Brandwatch
Want to track and analyze Reddit and its subreddits? We go through the best tools around so you can use subreddit analytics in...
Read more >
reddit.com: api documentation
Modhashes can be obtained via the /api/me.json call or in response data of listing endpoints. The preferred way to send a modhash is...
Read more >
Fail to call reddit's /api/submit - node.js - Stack Overflow
I'm trying to call /api/submit. var options = { url: 'https://oauth.reddit.com/api/submit', method: 'POST', headers: { 'Authorization': 'bearer '+usertoken , ' ...
Read more >
A Beginner's Guide to Reddit: How to Get Started & Be ...
This guide will help you learn more about what Reddit is, who uses it, what makes it different, and how to successfully get...
Read more >
Post on Reddit API With Python (PRAW) - JC Chouinard
In this post, we will see how to post to a subreddit using the PRAW ... If you know nothing about Python, make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found