Fix rare crash

pull/173/head
10maurycy10 3 years ago committed by GitHub
parent f4a5b67ceb
commit 45641b8c39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -107,8 +107,11 @@ class Shredder(object):
output = {k: item.__dict__[k] for k in item.__dict__ if not k.startswith("_")}
output["subreddit"] = output["subreddit"].title
output["author"] = output["author"].name
json.dump(output, fh, indent=2)
try:
json.dump(output, fh, indent=2)
except:
print("could not save post!")
def _remove_submission(self, sub):
self._logger.info("Deleting submission: #{id} {url}".format(id=sub.id, url=sub.url.encode("utf-8")))

Loading…
Cancel
Save