brikteknologier / seraph-model

thin model layer for seraph/neo4j (node.js)
MIT License
111 stars 28 forks source link

err.code.match is not a function #115

Closed JosephScript closed 8 years ago

JosephScript commented 8 years ago

I just updated seraph and seraph-model and I'm running into an error in regards to the error object. Rolled back and it worked fine. I'm running Neo4J 2.3.2., seraph 0.15.2 and seraph-model 0.9.0.

Thanks!

Uncaught Exception: err.code.match is not a function
Stack: TypeError: err.code.match is not a function
    at /Users/joseph/Source/aurelius-home/node_modules/seraph-model/lib/read.js:213:38
    at /Users/joseph/Source/aurelius-home/node_modules/seraph/lib/seraph.js:272:14
    at Seraph.<anonymous> (/Users/joseph/Source/aurelius-home/node_modules/seraph/lib/seraph.js:212:7)
    at Request._callback (/Users/joseph/Source/aurelius-home/node_modules/seraph-core/seraph-core.js:134:9)
    at Request.self.callback (/Users/joseph/Source/aurelius-home/node_modules/request/request.js:187:22)
    at emitTwo (events.js:100:13)
    at Request.emit (events.js:185:7)
    at Request.<anonymous> (/Users/joseph/Source/aurelius-home/node_modules/request/request.js:1044:10)
    at emitOne (events.js:90:13)
    at Request.emit (events.js:182:7)
    at IncomingMessage.<anonymous> (/Users/joseph/Source/aurelius-home/node_modules/request/request.js:965:12)
    at emitNone (events.js:85:20)
    at IncomingMessage.emit (events.js:179:7)
    at endReadableNT (_stream_readable.js:913:12)
    at _combinedTickCallback (node.js:377:13)
    at process._tickCallback (node.js:401:11)
srfoster commented 8 years ago

Same problem for me.

srfoster commented 8 years ago

For me it was caused because err.code was a number -- specifically a 401 because I hadn't supplied a username and password for my db connection.

Submitted a potential fix:

https://github.com/brikteknologier/seraph-model/pull/116