Improved error handling
This commit is contained in:
parent
588a3c3ea6
commit
ff68b5f70f
11
script.py
11
script.py
|
@ -663,8 +663,15 @@ def main():
|
||||||
logDir = Path(GLOBAL.arguments.log)
|
logDir = Path(GLOBAL.arguments.log)
|
||||||
download(postFromLog(logDir))
|
download(postFromLog(logDir))
|
||||||
sys.exit()
|
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:
|
if POSTS is None:
|
||||||
print("I could not find any posts in that URL")
|
print("I could not find any posts in that URL")
|
||||||
|
|
Loading…
Reference in a new issue