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
The error handling seems a bit shaky. When doing an ask query (Semantic MediaWiki) the info variable is undefined even though data.query.results has results. This causes the response to fall through all the ifs all they way town to the else case even though there is actually no error. And then crashes on api.js:206 because data.error is undefined.
I think this part of the code should only run if there actually is an error i.e. typeof data.error !== 'undefined'.
Debug: internal, implementation, error
TypeError: Cannot read property 'info' of undefined
at Request._callback (/home/max/projects/xml-phonebook/node_modules/nodemw/lib/api.js:208:63)
at Request.self.callback (/home/max/projects/xml-phonebook/node_modules/nodemw/node_modules/request/request.js:199:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (/home/max/projects/xml-phonebook/node_modules/nodemw/node_modules/request/request.js:1160:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/home/max/projects/xml-phonebook/node_modules/nodemw/node_modules/request/request.js:1111:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickDomainCallback (node.js:486:13)
TL;DR: It tries to report an error even though everything went fine.
The text was updated successfully, but these errors were encountered:
The error handling seems a bit shaky. When doing an
ask
query (Semantic MediaWiki) the info variable isundefined
even thoughdata.query.results
has results. This causes the response to fall through all the ifs all they way town to the else case even though there is actually no error. And then crashes on api.js:206 becausedata.error
isundefined
.I think this part of the code should only run if there actually is an error i.e.
typeof data.error !== 'undefined'
.This is my
params
object forclient.api.call
:and this is what the
data
variable contains:and this is the complete error:
TL;DR: It tries to report an error even though everything went fine.
The text was updated successfully, but these errors were encountered: