Skip to content
This repository has been archived by the owner on Dec 29, 2019. It is now read-only.

Commit

Permalink
Fix error handling in EMT request
Browse files Browse the repository at this point in the history
  • Loading branch information
MaanuelMM committed May 16, 2019
1 parent a5b596d commit b49470a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,18 @@ def send_parada(message):
bot.reply_to(message, data.PARADA_NO_ESTIMATION)
del token_response, token, arrive_stop_response, arrive_stop
except:
log_emt_error(token_response + "\n" + arrive_stop_response)
log = ""
try:
log += (str(token_response))
log += (str(arrive_stop_response))
except:
log += "\nSome data is missing."
log_emt_error(log)
bot.reply_to(message, data.PARADA_FAIL)
try:
del log, token_response, token, arrive_stop_response, arrive_stop
except:
pass

# Help command handler
@bot.message_handler(commands=['help'])
Expand Down

0 comments on commit b49470a

Please sign in to comment.