Skip to content

Commit

Permalink
send mail upon crash
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrejb committed Mar 21, 2017
1 parent 10aa808 commit 7d2d8ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion EA/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from decks import genome_to_decklist, write_decklist
from fitness import evaluate_deck_by_wins
from logger import log_experiment
from mail import send_mail

creator.create("FitnessMax", base.Fitness, weights=(1.0,))
creator.create("Individual", list, fitness=creator.FitnessMax)
Expand Down Expand Up @@ -127,4 +128,9 @@ def main():
log_experiment(top_list, median_list, worst_list, global_maximum, runtime, alpha_deck)

if __name__ == '__main__':
main()
try:
main()
except Exception as e:
print("Unexpected error:\n{}".format(e))
send_mail(['[email protected]', '[email protected]'], "The program has crashed:\n{}".format(e))

0 comments on commit 7d2d8ac

Please sign in to comment.