aboutsummaryrefslogtreecommitdiff
path: root/inverter-bot
diff options
context:
space:
mode:
Diffstat (limited to 'inverter-bot')
-rwxr-xr-xinverter-bot16
1 files changed, 11 insertions, 5 deletions
diff --git a/inverter-bot b/inverter-bot
index f888b6b..a101ed5 100755
--- a/inverter-bot
+++ b/inverter-bot
@@ -21,6 +21,7 @@ from telegram.ext import (
MessageHandler,
CallbackContext
)
+from telegram.error import TimedOut
class InverterClientWrapper:
@@ -121,7 +122,8 @@ def msg_status(update: Update, context: CallbackContext) -> None:
reply(update, html)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_shell(update: Update, context: CallbackContext) -> None:
@@ -185,7 +187,8 @@ def msg_generation(update: Update, context: CallbackContext) -> None:
reply(update, html)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_gs(update: Update, context: CallbackContext) -> None:
@@ -194,7 +197,8 @@ def msg_gs(update: Update, context: CallbackContext) -> None:
reply(update, status)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_ri(update: Update, context: CallbackContext) -> None:
@@ -203,7 +207,8 @@ def msg_ri(update: Update, context: CallbackContext) -> None:
reply(update, rated)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_errors(update: Update, context: CallbackContext) -> None:
@@ -212,7 +217,8 @@ def msg_errors(update: Update, context: CallbackContext) -> None:
reply(update, errors)
except Exception as e:
logging.exception(str(e))
- reply(update, 'exception: ' + str(e))
+ if not isinstance(e, TimedOut):
+ reply(update, 'exception: ' + str(e))
def msg_all(update: Update, context: CallbackContext) -> None: