clearbit / clearbit-node

Node library for querying the Clearbit business intelligence APIs
https://clearbit.com/docs
MIT License
69 stars 35 forks source link

Added headers to ClearbitError in order to pass back relevant data to caller #34

Open pdspicer opened 6 years ago

pdspicer commented 6 years ago

This is useful when encountering a rate-limit error. If headers are passed back, retry-after can be used to delay for the appropriate amount of time before attempting a follow-up call.

mkosowsk commented 6 years ago

@maccman any update on this PR? It would tidy up my code a bit with not a huge change 👍

davidlumley commented 6 years ago

Will make sure we review this today :+1:

davidlumley commented 6 years ago

We talked about it internally and think this definitely makes sense as a quality of life improvement!

It'd be great if we could add a spec to make sure they're being passed through in a consistent manner. Would you mind adding one @pdspicer and I can then go ahead and merge?

davidlumley commented 6 years ago

Hey @pdspicer just a bump — if you could add specs that'd be wonderful! If not, I'll circle round and add some when I have time :+1:

Thanks!