Remove empty except (#887)

This commit is contained in:
josephbiko
2018-07-09 20:54:43 +02:00
committed by Lonami
parent 4328663c78
commit e6981e7676
4 changed files with 17 additions and 8 deletions

View File

@@ -386,6 +386,7 @@ class MTProtoSender:
except asyncio.TimeoutError:
continue
except asyncio.CancelledError:
await self.disconnect()
return
except Exception as e:
if isinstance(e, ConnectionError):
@@ -425,6 +426,7 @@ class MTProtoSender:
except asyncio.TimeoutError:
continue
except asyncio.CancelledError:
await self.disconnect()
return
except Exception as e:
if isinstance(e, ConnectionError):
@@ -467,15 +469,19 @@ class MTProtoSender:
__log__.info('Server replied with an unknown type {:08x}: {!r}'
.format(e.invalid_constructor_id, e.remaining))
continue
except:
__log__.exception('Unhandled exception while unpacking')
except asyncio.CancelledError:
await self.disconnect()
return
except Exception as e:
__log__.exception('Unhandled exception while unpacking %s',e)
await asyncio.sleep(1)
else:
try:
await self._process_message(message)
except asyncio.CancelledError:
await self.disconnect()
return
except:
except Exception as e:
__log__.exception('Unhandled exception while '
'processing %s', message)
await asyncio.sleep(1)