|
@@ -1273,17 +1273,17 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
|
|
or 'Document'
|
|
or 'Document'
|
|
)
|
|
)
|
|
document = buffered_file
|
|
document = buffered_file
|
|
- except FileNotFoundError:
|
|
|
|
- document = None
|
|
|
|
|
|
+ except FileNotFoundError as e:
|
|
if buffered_file:
|
|
if buffered_file:
|
|
buffered_file.close()
|
|
buffered_file.close()
|
|
|
|
+ return e
|
|
else:
|
|
else:
|
|
use_stored_file_id = False
|
|
use_stored_file_id = False
|
|
if document is None:
|
|
if document is None:
|
|
logging.error(
|
|
logging.error(
|
|
"`document` is None, `send_document` returning..."
|
|
"`document` is None, `send_document` returning..."
|
|
)
|
|
)
|
|
- return
|
|
|
|
|
|
+ return Exception("No `document` provided")
|
|
sent_update = None
|
|
sent_update = None
|
|
try:
|
|
try:
|
|
sent_update = await self.sendDocument(
|
|
sent_update = await self.sendDocument(
|