Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting request-id #367

Closed
danlo opened this issue Jan 23, 2016 · 2 comments
Closed

Requesting request-id #367

danlo opened this issue Jan 23, 2016 · 2 comments

Comments

@danlo
Copy link

danlo commented Jan 23, 2016

Greetings,

I was reading up on the documentation about request_ids (see link below)

https://stripe.com/docs/api?lang=ruby#request_ids

However, I could not find a counter part the ruby gem for Stripe to obtain the request_id for the last request. The header does not appear to saved here:

https://github.com/stripe/stripe-ruby/blob/master/lib/stripe.rb#L264

I would like to use the request id to save in my own logs, so that I can route staff to the proper error faster.

How can I get the request id?

Regards,

Daniel Lo

@brandur
Copy link
Contributor

brandur commented Jan 23, 2016

Hey Daniel, thanks for logging this!

I'm a little hesitant to expose a #last_response type helper as seen in something like stripe/stripe-php#206 because as described in #313 it would be really nice to get this gem off of restclient and onto something a little more modern. Exposing a particular type of response object would go even further toward locking us into a particular HTTP client.

In the meantime (and forgive me if you've already seen this), StripeError does expose a #request_id accessor which is available anytime the API throws an error. It would of course be nice to be able to get a request ID at any time, but having one available in your logs during error cases is one of the concept's more valuable uses.

@brandur
Copy link
Contributor

brandur commented Feb 1, 2016

@danlo I'm going to close this out for now, but let me know if you have any further comments here. Thanks!

@brandur brandur closed this as completed Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants