server: nio API change for error responses.

The request type is now an enum.
This commit is contained in:
Damir Jelić 2018-09-12 20:16:49 +02:00
parent 933764bf8e
commit e9e614571d

View file

@ -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):