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