Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
4de93001
Commit
4de93001
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Make matrixfederationclient log more nicely
parent
659ead08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/http/matrixfederationclient.py
+12
-11
12 additions, 11 deletions
synapse/http/matrixfederationclient.py
with
12 additions
and
11 deletions
synapse/http/matrixfederationclient.py
+
12
−
11
View file @
4de93001
...
...
@@ -16,6 +16,7 @@
from
twisted.internet
import
defer
,
reactor
,
protocol
from
twisted.internet.error
import
DNSLookupError
from
twisted.python.failure
import
Failure
from
twisted.web.client
import
readBody
,
_AgentBase
,
_URI
from
twisted.web.http_headers
import
Headers
from
twisted.web._newclient
import
ResponseDone
...
...
@@ -146,14 +147,22 @@ class MatrixFederationHttpClient(object):
)
raise
SynapseError
(
400
,
"
Domain specified not found.
"
)
if
hasattr
(
e
,
"
reasons
"
):
reasons
=
"
,
"
.
join
(
f
.
value
.
message
for
f
in
e
.
reasons
)
else
:
reasons
=
e
.
message
logger
.
warn
(
"
Sending request failed to %s: %s %s
: %s
"
,
"
Sending request failed to %s: %s %s:
%s -
%s
"
,
destination
,
method
,
url_bytes
,
e
type
(
e
).
__name__
,
reasons
,
)
_print_ex
(
e
)
if
retries_left
:
yield
sleep
(
2
**
(
5
-
retries_left
))
...
...
@@ -447,14 +456,6 @@ def _readBodyToFile(response, stream, max_size):
return
d
def
_print_ex
(
e
):
if
hasattr
(
e
,
"
reasons
"
)
and
e
.
reasons
:
for
ex
in
e
.
reasons
:
_print_ex
(
ex
)
else
:
logger
.
warn
(
e
)
class
_JsonProducer
(
object
):
"""
Used by the twisted http client to create the HTTP body from json
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment