Patchwork [5/5] send-error-report: show response

login
register
mail settings
Submitter Martin Jansa
Date April 2, 2014, 12:25 p.m.
Message ID <1396441537-2911-5-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/70013/
State Accepted
Commit d2c395a618c4bbdd8a52a136f8b3822f448200d7
Headers show

Comments

Martin Jansa - April 2, 2014, 12:25 p.m.
* useful when debuging why it was refused by server

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 scripts/send-error-report | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/scripts/send-error-report b/scripts/send-error-report
index 0d85776..8eea3cf 100755
--- a/scripts/send-error-report
+++ b/scripts/send-error-report
@@ -53,9 +53,11 @@  def sendData(json_file, server):
             print response.status, response.reason
             res = response.read()
             if response.status == 200:
-                print res
+                print(res)
             else:
-                print("There was a problem submiting your data")
+                print("There was a problem submiting your data, response written in %s.response.html" % json_file)
+                with open("%s.response.html" % json_file, "w") as f:
+                    f.write(res)
             conn.close()
         except:
                 print("Server connection failed")