mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-20 08:54:06 +01:00
Handle failing to talk to master over replication
This commit is contained in:
parent
a2419b27fe
commit
6745b7de6d
1 changed files with 9 additions and 1 deletions
|
@ -17,11 +17,17 @@ import abc
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from six import raise_from
|
||||||
from six.moves import urllib
|
from six.moves import urllib
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import CodeMessageException, HttpResponseException
|
from synapse.api.errors import (
|
||||||
|
CodeMessageException,
|
||||||
|
HttpResponseException,
|
||||||
|
RequestSendFailed,
|
||||||
|
SynapseError,
|
||||||
|
)
|
||||||
from synapse.util.caches.response_cache import ResponseCache
|
from synapse.util.caches.response_cache import ResponseCache
|
||||||
from synapse.util.stringutils import random_string
|
from synapse.util.stringutils import random_string
|
||||||
|
|
||||||
|
@ -175,6 +181,8 @@ class ReplicationEndpoint(object):
|
||||||
# on the master process that we should send to the client. (And
|
# on the master process that we should send to the client. (And
|
||||||
# importantly, not stack traces everywhere)
|
# importantly, not stack traces everywhere)
|
||||||
raise e.to_synapse_error()
|
raise e.to_synapse_error()
|
||||||
|
except RequestSendFailed as e:
|
||||||
|
raise_from(SynapseError(502, "Failed to talk to master"), e)
|
||||||
|
|
||||||
defer.returnValue(result)
|
defer.returnValue(result)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue