From 19b6c43bee119b939d8d0cfe9210e81870e8f79d Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Thu, 22 Jan 2015 23:39:58 -0800 Subject: [PATCH] Try to show more meaningful output from submit-distances --- submit-distances.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/submit-distances.py b/submit-distances.py index 03afd7d0..be0dc66b 100644 --- a/submit-distances.py +++ b/submit-distances.py @@ -25,7 +25,7 @@ import sys import tradedb -from misc.edsc import StarSubmission +from misc.edsc import StarSubmission, annotate_submission_response from tkinter import Tk try: @@ -354,13 +354,16 @@ def main(): ) resp = sub.submit() - status = resp['status']['input'][0]['status'] - if status['statusnum'] == 0: - print(status['msg']) - else: - print("ERROR: {} ({})".format( - status['msg'], status['statusnum'], - )) + try: + annotate_submission_response(resp) + except: + status = resp['status']['input'][0]['status'] + if status['statusnum'] == 0: + print(status['msg']) + else: + print("ERROR: {} ({})".format( + status['msg'], status['statusnum'], + )) if __name__ == "__main__":