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
b1195c12
Commit
b1195c12
authored
10 years ago
by
Kegan Dougal
Browse files
Options
Downloads
Patches
Plain Diff
hs: Updated synapse.http.client to handle DNSLookupErrors and bail immediately.
parent
da31b96b
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/client.py
+6
-1
6 additions, 1 deletion
synapse/http/client.py
with
6 additions
and
1 deletion
synapse/http/client.py
+
6
−
1
View file @
b1195c12
...
...
@@ -15,6 +15,7 @@
from
twisted.internet
import
defer
,
reactor
from
twisted.internet.error
import
DNSLookupError
from
twisted.web.client
import
_AgentBase
,
_URI
,
readBody
from
twisted.web.http_headers
import
Headers
...
...
@@ -23,7 +24,7 @@ from synapse.util.async import sleep
from
syutil.jsonutil
import
encode_canonical_json
from
synapse.api.errors
import
CodeMessageException
from
synapse.api.errors
import
CodeMessageException
,
SynapseError
import
json
import
logging
...
...
@@ -198,6 +199,10 @@ class TwistedHttpClient(HttpClient):
logger
.
debug
(
"
Got response to %s
"
,
method
)
break
except
DNSLookupError
as
dns
:
logger
.
warn
(
"
DNS Lookup failed to %s with %s
"
,
destination
,
dns
)
raise
SynapseError
(
400
,
"
Domain specified not found.
"
)
except
Exception
as
e
:
logger
.
exception
(
"
Got error in _create_request
"
)
_print_ex
(
e
)
...
...
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