I am quite new to programming so that currently struggling to make telegram bot where I can send pre-defined template message to my receivers.
In the course of my work, I encountered 'error message' thrown like below when it tries to send messages to those whose 'entity' like user_name does not exist, wrongly spelled or whatever.
ERROR:root:Cannot find any entity corresponding to "CHANNELS2RSS BOT"
To just skip those entities, I wrote following codes --
except ValueError as e:
error_msg = str(e)
if "Cannot find any entity" in error_msg:
logging.error(error_msg + " >> skipping this entity")
break
Is this way of handling exception good? If there is another solution, please tell me..