histograph / api

Histograph API
https://api.histograph.io
MIT License
13 stars 4 forks source link

API server doesn't report this error #37

Closed wires closed 9 years ago

wires commented 9 years ago

plus it shouldn't error

undefined:130
          if (data.geometry.type !== undefined) {
                           ^
TypeError: Cannot read property 'type' of null
    at Object.validate [as pits] (eval at <anonymous> (/opt/histograph/io/node_modules/is-my-json-valid/node_modules/generate-function/index.js:1:0), <anonymous>:130:28)
    at DestroyableTransform.fs.createReadStream.pipe.on.on.allValid (/opt/histograph/io/index.js:232:54)
    at DestroyableTransform.emit (events.js:95:17)
    at DestroyableTransform.<anonymous> (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:786:14)
    at DestroyableTransform.emit (events.js:92:17)
    at emitReadable_ (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:448:10)
    at emitReadable (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:444:5)
    at readableAddChunk (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:187:9)
    at DestroyableTransform.Readable.push (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:149:10)
    at DestroyableTransform.Transform.push (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:145:32)
    at push (/opt/histograph/io/node_modules/ndjson/node_modules/split2/index.js:50:10)
    at DestroyableTransform.transform [as _transform] (/opt/histograph/io/node_modules/ndjson/node_modules/split2/index.js:33:5)
    at DestroyableTransform.Transform._read (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/opt/histograph/io/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
mmmenno commented 9 years ago

maybe offending record?

{"id":"Durgerdam-1817","name":"Durgerdam","type":"hg:Municipality",
"geometry":null,"hasBeginning":"1817-01-01",
"hasEnd":"1818-01-01",
"uri":"http:\/\/www.gemeentegeschiedenis.nl\/gemeentenaam\/Durgerdam",
"data":{"cbscode":"","amsterdamse code":""}}
bertspaan commented 9 years ago

@wires what about filtering out all nulls and ""s before checking the JSON schema?

bertspaan commented 9 years ago

@mmmenno , @wires does this error still occur with current datasets?

mmmenno commented 9 years ago

Have not seen this error in ages...