Skip to content

Handle Mechanize 503 errors gracefully #16

@xavriley

Description

@xavriley
/Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/gems/mechanize-2.7.3/lib/mechanize/http/agent.rb:308:in `fetch': 503 => Net::HTTPServiceUnavailable for http://www.dob.texas.gov/asp/entities/bkdetail.asp?charterno=3063&entity=26&status=all -- unhandled response (Mechanize::ResponseCodeError)

Received while running the us_tx bot locally. Would be good to handle this at a framework level I think.

Full backtrace:

/Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/gems/mechanize-2.7.3/lib/mechanize/http/agent.rb:308:in `fetch': 503 => Net::HTTPServiceUnavailable for http://www.dob.texas.gov/asp/entities/bkdetail.asp?charterno=3063&entity=26&status=all -- unhandled response (Mechanize::ResponseCodeError)
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/gems/mechanize-2.7.3/lib/mechanize.rb:440:in `get'
    from /Users/xavierriley/openc/external_bots/us_tx_dob_banking_license/lib/us_tx_dob_banking_license.rb:154:in `block in fetch_records'
    from /Users/xavierriley/openc/external_bots/us_tx_dob_banking_license/lib/us_tx_dob_banking_license.rb:152:in `each'
    from /Users/xavierriley/openc/external_bots/us_tx_dob_banking_license/lib/us_tx_dob_banking_license.rb:152:in `fetch_records'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bundler/gems/openc_bot-5b196c60f41b/lib/simple_openc_bot.rb:36:in `update_data'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bundler/gems/openc_bot-5b196c60f41b/lib/openc_bot/tasks.rb:63:in `block (3 levels) in <top (required)>'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bundler/gems/openc_bot-5b196c60f41b/lib/openc_bot/tasks.rb:135:in `only_process_running'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bundler/gems/openc_bot-5b196c60f41b/lib/openc_bot/tasks.rb:59:in `block (2 levels) in <top (required)>'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/rake/task.rb:205:in `call'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/rake/task.rb:200:in `each'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
    from /Users/xavierriley/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bundler/gems/openc_bot-5b196c60f41b/bin/openc_bot:12:in `<top (required)>'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bin/openc_bot:23:in `load'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bin/openc_bot:23:in `<main>'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bin/ruby_executable_hooks:15:in `eval'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385@external_bots/bin/ruby_executable_hooks:15:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions