server: nio API change for error responses.
The request type is now an enum.
This commit is contained in:
parent
933764bf8e
commit
e9e614571d
1 changed files with 2 additions and 4 deletions
|
@ -35,6 +35,7 @@ from nio import (
|
||||||
TransportResponse,
|
TransportResponse,
|
||||||
TransportType,
|
TransportType,
|
||||||
RoomMessagesResponse,
|
RoomMessagesResponse,
|
||||||
|
RequestType,
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import globals as G
|
from . import globals as G
|
||||||
|
@ -753,10 +754,7 @@ class MatrixServer(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO better error handling.
|
# TODO better error handling.
|
||||||
if (
|
if response.request_info.type in (RequestType.sync, RequestType.login):
|
||||||
response.request_info.type == "sync"
|
|
||||||
or response.request_info.type == "login"
|
|
||||||
):
|
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
|
|
||||||
def handle_response(self, response):
|
def handle_response(self, response):
|
||||||
|
|
Loading…
Reference in a new issue