mirror of
https://github.com/element-hq/synapse
synced 2024-09-01 23:50:22 +00:00
Fix up ResponseNeverReceived to str
This commit is contained in:
parent
e482541e1d
commit
5e24471469
1 changed files with 11 additions and 9 deletions
|
@ -146,21 +146,13 @@ class MatrixFederationHttpClient(object):
|
||||||
)
|
)
|
||||||
raise SynapseError(400, "Domain specified not found.")
|
raise SynapseError(400, "Domain specified not found.")
|
||||||
|
|
||||||
if hasattr(e, "reasons"):
|
|
||||||
reasons = ", ".join(
|
|
||||||
str(f.value.message)
|
|
||||||
for f in e.reasons
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
reasons = e.message
|
|
||||||
|
|
||||||
logger.warn(
|
logger.warn(
|
||||||
"Sending request failed to %s: %s %s: %s - %s",
|
"Sending request failed to %s: %s %s: %s - %s",
|
||||||
destination,
|
destination,
|
||||||
method,
|
method,
|
||||||
url_bytes,
|
url_bytes,
|
||||||
type(e). __name__,
|
type(e). __name__,
|
||||||
reasons,
|
_flatten_response_never_received(e),
|
||||||
)
|
)
|
||||||
|
|
||||||
if retries_left:
|
if retries_left:
|
||||||
|
@ -474,3 +466,13 @@ class _JsonProducer(object):
|
||||||
|
|
||||||
def stopProducing(self):
|
def stopProducing(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def _flatten_response_never_received(e):
|
||||||
|
if hasattr(e, "reasons"):
|
||||||
|
return ", ".join(
|
||||||
|
_flatten_response_never_received(f.value)
|
||||||
|
for f in e.reasons
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return "%s: %s" % (type(e), e.message,)
|
||||||
|
|
Loading…
Reference in a new issue