You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TypeError: Cannot read property 'method' of undefined]
TypeError: Cannot read property 'method' of undefined
at logResponse (/js-data-http/src/index.js:136:56)
at lib$es6$promise$$internal$$tryCatch (/js-data-http/node_modules/es6-promise/dist/es6-promise.js:331:16)
at lib$es6$promise$$internal$$invokeCallback (/js-data-http/node_modules/es6-promise/dist/es6-promise.js:343:17)
at lib$es6$promise$$internal$$publish (/js-data-http/node_modules/es6-promise/dist/es6-promise.js:314:11)
at lib$es6$promise$$internal$$publishRejection (/js-data-http/node_modules/es6-promise/dist/es6-promise.js:264:7)
at lib$es6$promise$asap$$flush (/js-data-http/node_modules/es6-promise/dist/es6-promise.js:125:9)
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)
Problem: When running js-data-http in Node.js it attempts to open a connection to whatever endpoint you have specified. If the server is not up, it creates an ECONNREFUSED Error. By default, js-data-http tries to log both error and success promise callbacks with the same function, logResponse, which assumes an object structure that is not an Error object.
@jmdobry For PRs, do you want the compiled source submitted as well?
From a security perspective you should not let anyone do this, but I want to hear your thoughts.
At any rate, your answer should be recorded in CONTRUBUTING.md.
Environment: Node.js
Version: 2.0.0
Stack:
Problem: When running js-data-http in Node.js it attempts to open a connection to whatever endpoint you have specified. If the server is not up, it creates an
ECONNREFUSED
Error. By default, js-data-http tries to log both error and success promise callbacks with the same function,logResponse
, which assumes an object structure that is not an Error object.ECONNREFUSED Error object:
Line in
logResponse()
assumes adata.config.method...
object structure to exist.I will work on a PR for this.
The text was updated successfully, but these errors were encountered: