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,
|
||||
TransportType,
|
||||
RoomMessagesResponse,
|
||||
RequestType,
|
||||
)
|
||||
|
||||
from . import globals as G
|
||||
|
@ -753,10 +754,7 @@ class MatrixServer(object):
|
|||
)
|
||||
|
||||
# TODO better error handling.
|
||||
if (
|
||||
response.request_info.type == "sync"
|
||||
or response.request_info.type == "login"
|
||||
):
|
||||
if response.request_info.type in (RequestType.sync, RequestType.login):
|
||||
self.disconnect()
|
||||
|
||||
def handle_response(self, response):
|
||||
|
|
Loading…
Reference in a new issue