core: fix failure raising with exception classes:
When raising a `Failure` with an exception, the `Exception` class can't be used, it must be an instance.
This commit is contained in:
parent
90c6f11415
commit
d3113ed2d8
1 changed files with 5 additions and 5 deletions
|
|
@ -728,7 +728,7 @@ class XEP_0234(BaseApplicationHandler):
|
|||
try:
|
||||
file_elt = next(desc_elt.elements(NS_JINGLE_FT, "file"))
|
||||
except StopIteration:
|
||||
raise failure.Failure(exceptions.DataError)
|
||||
raise failure.Failure(exceptions.DataError())
|
||||
file_data = {"progress_id": self.get_progress_id(session, content_name)}
|
||||
|
||||
if senders == self._j.ROLE_RESPONDER:
|
||||
|
|
@ -800,7 +800,7 @@ class XEP_0234(BaseApplicationHandler):
|
|||
try:
|
||||
hash_algo = self._hash.parse_hash_used_elt(file_elt)
|
||||
except exceptions.NotFound:
|
||||
raise failure.Failure(exceptions.DataError)
|
||||
raise failure.Failure(exceptions.DataError())
|
||||
|
||||
# deferred to track end of transfer
|
||||
finished_d = content_data["finished_d"] = defer.Deferred()
|
||||
|
|
@ -838,7 +838,7 @@ class XEP_0234(BaseApplicationHandler):
|
|||
try:
|
||||
file_data["size"] = int(file_data["size"])
|
||||
except ValueError:
|
||||
raise failure.Failure(exceptions.DataError)
|
||||
raise failure.Failure(exceptions.DataError())
|
||||
|
||||
content_data["application_data"]["file_data"] = file_data
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue