fork download
  1. class TelegramDoesNotExistError(Exception):
  2. pass
  3.  
  4. def start():
  5. raise TelegramDoesNotExistError('No user with this telegram')
  6.  
  7. def send_message_to_client(message):
  8. print('Server message: ', message)
  9.  
  10. try:
  11. start()
  12. except TelegramDoesNotExistError as e:
  13. send_message_to_client(str(e))
Success #stdin #stdout 0.01s 27704KB
stdin
Standard input is empty
stdout
Server message:  No user with this telegram