Apply sanity to the transport client interface. Convert 'make_join' and 'send_join' to accept iterables of destinations

This commit is contained in:
Erik Johnston 2015-02-04 16:28:12 +00:00
parent 95e2d2d36d
commit ae46f10fc5
6 changed files with 151 additions and 92 deletions

View file

@ -39,7 +39,7 @@ class Codes(object):
TOO_LARGE = "M_TOO_LARGE"
class CodeMessageException(Exception):
class CodeMessageException(RuntimeError):
"""An exception with integer code and message string attributes."""
def __init__(self, code, msg):
@ -227,3 +227,9 @@ class FederationError(RuntimeError):
"affected": self.affected,
"source": self.source if self.source else self.affected,
}
class HttpResponseException(CodeMessageException):
def __init__(self, code, msg, response):
self.response = response
super(HttpResponseException, self).__init__(code, msg)