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

Cannot read property 'headers' of undefined #2

Closed
aartiles opened this issue Oct 1, 2013 · 4 comments
Closed

Cannot read property 'headers' of undefined #2

aartiles opened this issue Oct 1, 2013 · 4 comments

Comments

@aartiles
Copy link

aartiles commented Oct 1, 2013

Hi,
My app crash whenever Fullcontact send responses without headers. Could you check if res.headers exists before accessing res.headers['x-rate-limit-reset']?

Thanks!

"TypeError: Cannot read property 'headers' of undefined",
" at Request.requested (/home/socialb/node_modules/fullcontact/index.js:75:26)",
" at Request.init.self.callback (/home/socialb/node_modules/fullcontact/node_modules/request/index.js:148:22)",
" at Request.EventEmitter.emit (events.js:96:17)",
" at ClientRequest.Request.init.self.clientErrorHandler (/home/socialb/node_modules/fullcontact/node_modules/request/index.js:257:10)",
" at ClientRequest.EventEmitter.emit (events.js:96:17)",
" at CleartextStream.socketCloseListener (http.js:1424:9)",
" at CleartextStream.EventEmitter.emit (events.js:126:20)",
" at SecurePair.destroy (tls.js:956:22)",
" at process.startup.processNextTick.process._tickCallback (node.js:244:9)"
@3rd-Eden
Copy link
Member

3rd-Eden commented Oct 1, 2013

Is this reproducible in any way?

Sent from my iPhone

On Oct 1, 2013, at 18:24, Alfredo Artiles notifications@github.com wrote:

Hi,
My app crash whenever Fullcontact send responses without headers. Could you check if res.headers exists before accessing res.headers['x-rate-limit-reset']?

Thanks!

"TypeError: Cannot read property 'headers' of undefined",
" at Request.requested (/home/socialb/node_modules/fullcontact/index.js:75:26)",
" at Request.init.self.callback (/home/socialb/node_modules/fullcontact/node_modules/request/index.js:148:22)",
" at Request.EventEmitter.emit (events.js:96:17)",
" at ClientRequest.Request.init.self.clientErrorHandler (/home/socialb/node_modules/fullcontact/node_modules/request/index.js:257:10)",
" at ClientRequest.EventEmitter.emit (events.js:96:17)",
" at CleartextStream.socketCloseListener (http.js:1424:9)",
" at CleartextStream.EventEmitter.emit (events.js:126:20)",
" at SecurePair.destroy (tls.js:956:22)",
" at process.startup.processNextTick.process._tickCallback (node.js:244:9)"


Reply to this email directly or view it on GitHub.

@aartiles
Copy link
Author

aartiles commented Oct 1, 2013

It's kind of random. Sometimes res.headers comes empty from fullcontact API but I don't know how to reproduce it.

@3rd-Eden
Copy link
Member

3rd-Eden commented Oct 1, 2013

I'm now checking if there are errors before parsing the headers. So you will most likely receive an error argument in your callbacks now. Still would love to know what causes this, but at least it's not crashing you any more.

Release will be in npm in a couple of minutes.

@aartiles
Copy link
Author

aartiles commented Oct 1, 2013

Great, I'll keep you posted. Thanks

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