]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
scripts: stop using RuntimeError, for #639
authorBrian Warner <warner@lothar.com>
Mon, 23 Feb 2009 00:31:06 +0000 (17:31 -0700)
committerBrian Warner <warner@lothar.com>
Mon, 23 Feb 2009 00:31:06 +0000 (17:31 -0700)
src/allmydata/scripts/common_http.py
src/allmydata/scripts/tahoe_backup.py

index dda3a9208a3efb2a7e7f50119c3a89a09b77a712..c62dfaec4fa5ec82cf4ea9d0b92104986fde4cb3 100644 (file)
@@ -27,7 +27,7 @@ def do_http(method, url, body=""):
     if isinstance(body, str):
         body = StringIO(body)
     elif isinstance(body, unicode):
-        raise RuntimeError("do_http body must be a bytestring, not unicode")
+        raise TypeError("do_http body must be a bytestring, not unicode")
     else:
         # We must give a Content-Length header to twisted.web, otherwise it
         # seems to get a zero-length file. I suspect that "chunked-encoding"
index 55e07fc0f1533ffbf246db95abda2f6a60bd796d..f75aafaf9481ea6bd4aa427f17c197bac9ad5faa 100644 (file)
@@ -9,9 +9,12 @@ from allmydata import uri
 from allmydata.util import time_format
 from allmydata.scripts import backupdb
 
+class HTTPError(Exception):
+    pass
+
 def raiseHTTPError(msg, resp):
     msg = msg + ": %s %s %s" % (resp.status, resp.reason, resp.read())
-    raise RuntimeError(msg)
+    raise HTTPError(msg)
 
 def readonly(writedircap):
     return uri.from_string_dirnode(writedircap).get_readonly().to_string()