Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
Added exception handling for main
Browse files Browse the repository at this point in the history
  • Loading branch information
sqz269 committed Sep 11, 2019
1 parent 69d7b8a commit ae05f44
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kahootAuto.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def doGameLoop(self):
self.logger.info("Current Question is: {} | Answer Shape: {}".format(questionNumber, self.answerDict.get(questionNumber)))
time.sleep(self.answerDelay)
self.driver.find_element_by_class_name(self.CVT_SHAPE_CLASSNAME.get(self.answerDict.get(questionNumber))).click()
except Exception as e:
except Exception:
self.logger.exception("Failed to answer question number: {}; Supposed Answer: {}. Execution will continue".format(questionNumber, self.answerDict.get(questionNumber)))
else:
self.logger.debug("Not In Question stage. waiting")
Expand Down Expand Up @@ -180,4 +180,9 @@ def main():
getUserInput()


main()
try:
main()
except Exception as e:
print("Failed to run; Exception: {}".format(e))
print("Press Enter to exit")
input(); raise SystemExit(1);

0 comments on commit ae05f44

Please sign in to comment.