1
0
Fork 0
mirror of synced 2024-06-29 11:30:30 +12:00

Improved error handling

This commit is contained in:
Ali Parlakci 2018-08-10 19:50:52 +03:00
parent 588a3c3ea6
commit ff68b5f70f

View file

@ -663,8 +663,15 @@ def main():
logDir = Path(GLOBAL.arguments.log)
download(postFromLog(logDir))
sys.exit()
POSTS = getPosts(prepareAttributes())
try:
POSTS = getPosts(prepareAttributes())
except Exception as exc:
logging.error(sys.exc_info()[0].__name__,
exc_info=full_exc_info(sys.exc_info()))
print(log_stream.getvalue(),noPrint=True)
print(exc)
sys.exit()
if POSTS is None:
print("I could not find any posts in that URL")