Don't catch errors that can't happen
This commit is contained in:
parent
007ac7abb5
commit
4bb6a27745
@ -721,7 +721,6 @@ class Telegram(RPCHandler):
|
|||||||
Handler for /locks.
|
Handler for /locks.
|
||||||
Returns the currently active locks
|
Returns the currently active locks
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
locks = self._rpc._rpc_locks()
|
locks = self._rpc._rpc_locks()
|
||||||
message = tabulate([[
|
message = tabulate([[
|
||||||
lock['id'],
|
lock['id'],
|
||||||
@ -733,8 +732,6 @@ class Telegram(RPCHandler):
|
|||||||
message = f"<pre>{escape(message)}</pre>"
|
message = f"<pre>{escape(message)}</pre>"
|
||||||
logger.debug(message)
|
logger.debug(message)
|
||||||
self._send_msg(message, parse_mode=ParseMode.HTML)
|
self._send_msg(message, parse_mode=ParseMode.HTML)
|
||||||
except RPCException as e:
|
|
||||||
self._send_msg(str(e))
|
|
||||||
|
|
||||||
@authorized_only
|
@authorized_only
|
||||||
def _delete_locks(self, update: Update, context: CallbackContext) -> None:
|
def _delete_locks(self, update: Update, context: CallbackContext) -> None:
|
||||||
@ -742,7 +739,6 @@ class Telegram(RPCHandler):
|
|||||||
Handler for /delete_locks.
|
Handler for /delete_locks.
|
||||||
Returns the currently active locks
|
Returns the currently active locks
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
arg = context.args[0] if context.args and len(context.args) > 0 else None
|
arg = context.args[0] if context.args and len(context.args) > 0 else None
|
||||||
lockid = None
|
lockid = None
|
||||||
pair = None
|
pair = None
|
||||||
@ -754,8 +750,6 @@ class Telegram(RPCHandler):
|
|||||||
|
|
||||||
self._rpc._rpc_delete_lock(lockid=lockid, pair=pair)
|
self._rpc._rpc_delete_lock(lockid=lockid, pair=pair)
|
||||||
self._locks(update, context)
|
self._locks(update, context)
|
||||||
except RPCException as e:
|
|
||||||
self._send_msg(str(e))
|
|
||||||
|
|
||||||
@authorized_only
|
@authorized_only
|
||||||
def _whitelist(self, update: Update, context: CallbackContext) -> None:
|
def _whitelist(self, update: Update, context: CallbackContext) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user