jijordre / node-solr-smart-client

A node.js solr-client smart constructor
MIT License
5 stars 6 forks source link

uncaught Error with reading response #2

Open daanaerts opened 8 years ago

daanaerts commented 8 years ago
                    instanceCollections = data.response.arr[0].str;
                                                       ^

TypeError: Cannot read property 'arr' of undefined
    at /Users/daanaerts/Projects/VentureIQ_/servers/api/node_modules/node-solr-smart-client/lib/index.js:102:56
    at Object.ConnectManager.handleResponse (/Users/daanaerts/Projects/VentureIQ_/servers/api/node_modules/node-rest-client/lib/node-rest-client.js:422:5)
    at Object.ConnectManager.handleEnd (/Users/daanaerts/Projects/VentureIQ_/servers/api/node_modules/node-rest-client/lib/node-rest-client.js:396:10)
    at IncomingMessage.<anonymous> (/Users/daanaerts/Projects/VentureIQ_/servers/api/node_modules/node-rest-client/lib/node-rest-client.js:561:13)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at nextTickCallbackWith2Args (node.js:437:9)
    at process._tickCallback (node.js:351:17)```
xs0358 commented 8 years ago

If response is XML, the code doesn't seem to work with the xml. add "&wt=json" will get to another if-then route and is working fine.