CUL-DigitalServices / libraries-gateway

Cambridge Libraries
1 stars 4 forks source link

AquaBrowser client API fails to handle AquaBrowser response to search for "Charles Darwin : a biography / John Bowlby" #230

Open ucamhal opened 10 years ago

ucamhal commented 10 years ago

Search for Charles Darwin : a biography / John Bowlby : http://www.libraries.cam.ac.uk/find-a-resource?q=Charles+Darwin+%3A+a+biography+%2F+John+Bowlby&x=27&y=27

Library Gateway responds with:

Warning:

An error occurred while fetching Aquabrowser data

An error is thrown from the aquabrowser api.js file. The error log contains:

[2014-07-14T15:16:18.115Z] ERROR: system/18081 on Gravel.local: Cannot read property 'lbl' of undefined
    TypeError: Cannot read property 'lbl' of undefined
      at /Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:407:39
      at Array.forEach (native)
      at Function._.each._.forEach (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/underscore/underscore.js:79:11)
      at /Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:404:15
      at Function._.each._.forEach (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/underscore/underscore.js:87:22)
      at _getFacets (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:388:11)
      at xml2js.parseString._doCreateResourceModel (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:228:37)
      at _createResourceModel (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:362:20)
      at xml2js.parseString._doCreateResourceModel (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:213:25)
      at xml2js.parseString.callback.code (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:271:33)
      at Array.forEach (native)
      at Function._.each._.forEach (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/underscore/underscore.js:79:11)
      at /Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:268:31
      at Parser.<anonymous> (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/lib/xml2js.js:384:20)
      at Parser.EventEmitter.emit (events.js:95:17)
      at Object.onclosetag (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/lib/xml2js.js:348:26)
      at emit (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
      at emitNode (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
      at closeTag (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
      at Object.write (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
      at Parser.exports.Parser.Parser.parseString (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/lib/xml2js.js:403:31)
      at Parser.parseString (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/lib/xml2js.js:6:61)
      at Object.exports.parseString (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/xml2js/lib/xml2js.js:433:19)
      at Request._callback (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/lib/controllers/api/search/aquabrowser/api.js:140:16)
      at Request.self.callback (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/request/request.js:122:22)
      at Request.EventEmitter.emit (events.js:98:17)
      at Request.<anonymous> (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/request/request.js:1019:14)
      at Request.EventEmitter.emit (events.js:117:20)
      at IncomingMessage.<anonymous> (/Users/hwtb2/Public/projects/ul/librarygateway/libraries-gateway/node_modules/request/request.js:970:12)
      at IncomingMessage.EventEmitter.emit (events.js:117:20)
      at _stream_readable.js:919:16
      at process._tickCallback (node.js:419:13)