Skip to content

How to ensure updates queue does not get stuck indefinitely when there's one error? #205

Answered by printercu
marckohlbrugge asked this question in Q&A
Discussion options

You must be logged in to vote

I would say that the way of processing errors will depend on the application, as somebody may want to stop accepting requests until app is fixed. Your option is good to go with. You may want to consider adding support for other types of responses, such as callback and/or inline queries. Here is the code from one of the bots:

  def process(*)
    super
  rescue StandardError => e
    raise e if Rails.env.test?
    logger.error { ([e.message] + e.backtrace).join("\n") }
    Rollbar.error(e)
    respond_with_error(e)
    # suppress error because telegram will resend requests otherwise
  end

  def respond_with_error(error)
    text = "#Error: #{error}" # suitable only for trusted chats
    if 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by marckohlbrugge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants