Skip to content

Instantly share code, notes, and snippets.

View Thewsomeguy's full-sized avatar

Zach Thewsomeguy

  • United States
  • 13:39 (UTC -05:00)
View GitHub Profile
import praw
from requests.exceptions import ConnectionError, HTTPError, Timeout
def failable(f):
def wrapped(*args, **kwargs):
try:
return f(*args, **kwargs)
except praw.errors.APIException:
full = traceback.format_exc()
logging.warning("Reddit API call failed! %s" % full)