1
0
mirror of https://github.com/konpa/devicon.git synced 2025-02-24 01:02:22 +01:00

Changed return to sys.exit in python script to show error

This commit is contained in:
Thomas Bui 2020-12-31 12:21:13 -08:00
parent fce491e4ce
commit 6c0122648a
2 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,5 @@
from pathlib import Path
import sys
from selenium.common.exceptions import TimeoutException
# pycharm complains that build_assets is an unresolved ref
@ -11,8 +12,7 @@ def main():
args = arg_getters.get_selenium_runner_args()
new_icons = filehandler.find_new_icons(args.devicon_json_path, args.icomoon_json_path)
if len(new_icons) == 0:
print("No files need to be uploaded. Ending script...")
return
sys.exit("No files need to be uploaded. Ending script...")
# print list of new icons
print("List of new icons:", *new_icons, sep = "\n")
@ -32,8 +32,9 @@ def main():
filehandler.rename_extracted_files(args.download_path)
print("Task completed.")
except TimeoutException as e:
print(e)
print(e.stacktrace)
sys.exit("Selenium Time Out Error: \n" + e)
except Exception as e:
sys.exit(e)
finally:
runner.close()

View File

@ -38,9 +38,9 @@ def main():
runner.upload_svgs(svgs, screenshot_folder)
print("Task completed.")
except TimeoutException as e:
print("Selenium Time Out Error: ", e.stacktrace, sep='\n')
sys.exit("Selenium Time Out Error: \n" + e)
except Exception as e:
print(e)
sys.exit(e)
finally:
runner.close()