Catching Faraday/HTTP Net Errors #78

Closed
3en opened this Issue Mar 6, 2013 · 4 comments

Comments

Projects
None yet
3 participants
@3en

3en commented Mar 6, 2013

Hey guys,

Does anyone know what the best practice way to catch Faraday/HTTP Net exceptions with the zendesk api gem?

I'm hitting timeout issues when iterating through .each_page on the Search API

e.g

client.search(:query => "my search query").each_page do |resource, page|
  # all resources will be yielded along with the page
end

insert_callback only works when the connection successfully returns and not when there is a timeout.

e.g

client.insert_callback do |env|
  puts env[:response_headers]
end
@3en

This comment has been minimized.

Show comment Hide comment
@3en

3en Mar 20, 2013

@steved555 Hey Steve, sorry to bother you. Do you know if it's possible with the gem to catch 404s?

3en commented Mar 20, 2013

@steved555 Hey Steve, sorry to bother you. Do you know if it's possible with the gem to catch 404s?

@stephiechou

This comment has been minimized.

Show comment Hide comment
@stephiechou

stephiechou May 31, 2013

@3en Did you find how to do it ?

In my case, I would like to rescue response status 500 in my controller when I create ticket

@3en Did you find how to do it ?

In my case, I would like to rescue response status 500 in my controller when I create ticket

@3en

This comment has been minimized.

Show comment Hide comment
@3en

3en May 31, 2013

@stephiechou Try this issue #71
@steved555 added in the ability to catch exceptions.

3en commented May 31, 2013

@stephiechou Try this issue #71
@steved555 added in the ability to catch exceptions.

@steved

This comment has been minimized.

Show comment Hide comment
@steved

steved Jun 10, 2013

Contributor

Thanks for helping out @3en. Closing the issue.

Contributor

steved commented Jun 10, 2013

Thanks for helping out @3en. Closing the issue.

@steved steved closed this Jun 10, 2013

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