mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
parent
f17d7e9c5e
commit
29d122e810
|
@ -52,7 +52,7 @@ class UserMethods(TelegramBaseClient):
|
|||
exceptions.append(None)
|
||||
results.append(result)
|
||||
request_index += 1
|
||||
if exceptions:
|
||||
if any(x is not None for x in exceptions):
|
||||
raise MultiError(exceptions, results, requests)
|
||||
else:
|
||||
return results
|
||||
|
|
|
@ -78,13 +78,13 @@ class MultiError(Exception):
|
|||
raise ValueError(
|
||||
'Need result, exception and request for each error')
|
||||
for e, req in zip(exceptions, requests):
|
||||
if not isinstance(e, BaseException):
|
||||
if not isinstance(e, BaseException) and e is not None:
|
||||
raise TypeError(
|
||||
'Expected and exception object, not %r' % e
|
||||
"Expected an exception object, not '%r'" % e
|
||||
)
|
||||
if not isinstance(req, TLRequest):
|
||||
raise TypeError(
|
||||
'Expected TLRequest object, not %r' % req
|
||||
"Expected TLRequest object, not '%r'" % req
|
||||
)
|
||||
|
||||
if len(exceptions) == 1:
|
||||
|
|
Loading…
Reference in New Issue
Block a user