[tor-commits] [flashproxy/master] Catch a POST error, print an error message, exit with nonzero status.
dcf at torproject.org
dcf at torproject.org
Fri Jul 6 14:38:31 UTC 2012
commit 46edf49c7cb8ceaf09ec8fbd84aae870eb82aeff
Author: David Fifield <david at bamsoftware.com>
Date: Fri Jul 6 06:46:32 2012 -0700
Catch a POST error, print an error message, exit with nonzero status.
---
flashproxy-reg-http.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/flashproxy-reg-http.py b/flashproxy-reg-http.py
index 8892fb2..209f77e 100755
--- a/flashproxy-reg-http.py
+++ b/flashproxy-reg-http.py
@@ -101,7 +101,11 @@ else:
spec = format_addr(options.remote_addr)
http = httplib.HTTPConnection(*options.facilitator_addr)
-http.request("POST", "/", urllib.urlencode({"client": spec}))
+try:
+ http.request("POST", "/", urllib.urlencode({"client": spec}))
+except Exception, e:
+ print >> sys.stderr, "Failed to register: %s" % str(e)
+ sys.exit(1)
http.close()
print "Registered \"%s\" with %s." % (spec, format_addr(options.facilitator_addr))
More information about the tor-commits
mailing list