Skip to content

Commit

Permalink
Add error handling that sucks
Browse files Browse the repository at this point in the history
  • Loading branch information
evantypanski committed Mar 25, 2019
1 parent 430bfca commit a266a34
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions escape-room-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def puzzle_done(puzzle):
print("done", puzzle)
data = aio.receive(PUZZLE_FEEDS[puzzle])
data = data.value.split()
aio.send(PUZZLE_FEEDS[puzzle], str(data[0]) + " DNE")
try:
aio.send(PUZZLE_FEEDS[puzzle], str(data[0]) + " DNE")
except:
return
status[puzzle] = "DNE"
return puzzle + " DNE"

Expand All @@ -63,15 +66,21 @@ def puzzle_reset(puzzle):
if puzzle == "ALL":
print("RESETTING ALL PUZZLES")
for feed in list(PUZZLE_FEEDS.keys()):
aio.send(PUZZLE_FEEDS[feed], "0 RST")
try:
aio.send(PUZZLE_FEEDS[feed], "0 RST")
except:
return
status[feed] = "0 RST"
return "ALL RST"

print("reset", puzzle)

data = aio.receive(PUZZLE_FEEDS[puzzle])
data = data.value.split()
aio.send(PUZZLE_FEEDS[puzzle], str(data[0]) + " RST")
try:
aio.send(PUZZLE_FEEDS[puzzle], str(data[0]) + " RST")
except:
return
status[puzzle] = "RST"
return puzzle + " RST"

Expand Down

0 comments on commit a266a34

Please sign in to comment.