Generalized exception handling to handle strange errors like captchas.

This commit is contained in:
Michael Lazar
2015-12-03 18:15:53 -08:00
parent ea05235ddc
commit 9c6d3ab542
3 changed files with 29 additions and 39 deletions

View File

@@ -124,7 +124,8 @@ class SubredditPage(Page):
title, content = text.split('\n', 1)
with self.term.loader(message='Posting', delay=0):
submission = self.reddit.submit(name, title, text=content)
submission = self.reddit.submit(name, title, text=content,
raise_captcha_exception=True)
# Give reddit time to process the submission
time.sleep(2.0)
if self.term.loader.exception: