Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
weebzone authored Nov 9, 2022
1 parent 878b15f commit 1b5714f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions bot/helper/ext_utils/telegraph_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,9 @@ def edit_telegraph(self, path, telegraph_content):
)
return


telegraph=TelegraphHelper(f'{AUTHOR_NAME}', f'{AUTHOR_URL}')
try:
telegraph=TelegraphHelper(f'{AUTHOR_NAME}', f'{AUTHOR_URL}')
except Exception as err:
LOGGER.warning(f"Can't Create Telegraph Account: {err}")
telegraph = None
pass
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def __onDownloadComplete(self):
def __download(self, message, path):
try:
download = message.download(file_name=path, progress=self.__onDownloadProgress)
if self.__is_cancelled:
self.__onDownloadError('Cancelled by user!')
return
except Exception as e:
LOGGER.error(str(e))
return self.__onDownloadError(str(e))
Expand Down Expand Up @@ -125,4 +128,4 @@ def add_download(self, message, path, filename):
def cancel_download(self):
LOGGER.info(f'Cancelling download on user request: {self.__id}')
self.__is_cancelled = True
self.__onDownloadError('Cancelled by user!')

0 comments on commit 1b5714f

Please sign in to comment.