From 1f548f3a7ec4a0da8063879dbc2d5a22af1e0089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 May 2019 10:54:01 +0200 Subject: [PATCH] client: Handle client errors while confirming the auth string. --- pantalaimon/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pantalaimon/client.py b/pantalaimon/client.py index ad609eb..204eeac 100644 --- a/pantalaimon/client.py +++ b/pantalaimon/client.py @@ -2,6 +2,7 @@ import asyncio from pprint import pformat from typing import Any, Dict, Optional +from aiohttp.client_exceptions import ClientConnectionError from nio import (AsyncClient, ClientConfig, EncryptionError, KeysQueryResponse, MegolmEvent, RoomEncryptedEvent, SyncResponse, @@ -192,7 +193,10 @@ class PanClient(AsyncClient): self.send_info("No such verification process found.") return - await self.confirm_short_auth_string(sas.transaction_id) + try: + await self.confirm_short_auth_string(sas.transaction_id) + except ClientConnectionError as e: + await self.send_info(f"Error confirming short auth string: {e}") device = sas.other_olm_device if sas.verified: