Skip to content

Commit f01082e

Browse files
authored
Try making github update sending a bit more robust
1 parent c16df09 commit f01082e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bot/github.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
from typing import Callable
33

4-
from telegram import ParseMode
4+
from telegram import ParseMode, TelegramError
55
from telegram.ext import CallbackContext, Dispatcher
66

77
from bot.const import DEFAULT_TRUNCATION_LIMIT
@@ -68,8 +68,11 @@ def _send(self, repo, text, check_repo: Callable[[Repo], bool], suffix=REPLY_MES
6868
except KeyError:
6969
text = truncate(text, TRUNCATED_MESSAGE, suffix, max_length=truncation_limit)
7070

71-
self.dispatcher.bot.send_message(chat_id=chat_id, text=text,
72-
parse_mode=ParseMode.HTML, disable_web_page_preview=True)
71+
try:
72+
self.dispatcher.bot.send_message(chat_id=chat_id, text=text,
73+
parse_mode=ParseMode.HTML, disable_web_page_preview=True)
74+
except TelegramError:
75+
logging.error('error while sending github update', exc_info=1)
7376

7477
def issues(self, update, _):
7578
# Issue opened, edited, closed, reopened, assigned, unassigned, labeled,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy