Catching Excon::Errors::Errors fails with timeout in Heroku::API#request #17

Closed
dim opened this Issue Jun 13, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

dim commented Jun 13, 2012

Currently, timeouts are caught by rescue Excon::Errors::Error, but a Excon::Errors::Timeout doesn't have a #response method causing undefined method 'response' for #<Excon::Errors::Timeout...

Proposed change:

def request(params, &block)
  begin
    response = @connection.request(params, &block)
  rescue Excon::Errors::HTTPStatusError => error # Only HTTPStatusError has #response
    ...
  end # Raise on everything else
Owner

geemus commented Jun 13, 2012

@dim - good catch and sounds like a reasonable fix. Mind packaging it up as a pull request so you can get credit for it? Thanks!

Contributor

dim commented Jun 13, 2012

Done

dim closed this Jun 13, 2012

Owner

geemus commented Jun 13, 2012

@dim - great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment