Skip to content

Catch warning from unsupported hierarchy entries - #149

Open
orangejulius wants to merge 1 commit into
masterfrom
fix-hierarchy-errors
Open

Catch warning from unsupported hierarchy entries#149
orangejulius wants to merge 1 commit into
masterfrom
fix-hierarchy-errors

Conversation

@orangejulius

Copy link
Copy Markdown
Member

During an import I noticed an error like the following:

error TypeError: Cannot read properties of undefined (reading 'name')
  at /code/import/source/whosonfirst/map/hierarchies.js:26:62
  at Array.forEach (<anonymous>)
  at Object.mapper [as hierarchies] (/code/import/source/whosonfirst/map/hierarchies.js:24:15)
  at mapper (/code/import/source/whosonfirst/map/place.js:39:7)
  at DestroyableTransform._transform (/code/import/mapperStream.js:7:21)
  at Transform._read (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:166:10)
  at Transform._write (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:155:83)
  at doWrite (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:390:139)
  at writeOrBuffer (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:381:5)
  at Writable.write (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:11)

After some investigation these errors don't appar to be hurting anything, they happen when a record in a layer we don't currently support is imported. In this case it was the postalregion layer.

We could consider supporting that layer in the future, which I think is also easy, but in the meantime we should at least silence these errors.

During an import I noticed an error like the following:

    error TypeError: Cannot read properties of undefined (reading 'name')
      at /code/import/source/whosonfirst/map/hierarchies.js:26:62
      at Array.forEach (<anonymous>)
      at Object.mapper [as hierarchies] (/code/import/source/whosonfirst/map/hierarchies.js:24:15)
      at mapper (/code/import/source/whosonfirst/map/place.js:39:7)
      at DestroyableTransform._transform (/code/import/mapperStream.js:7:21)
      at Transform._read (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:166:10)
      at Transform._write (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:155:83)
      at doWrite (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:390:139)
      at writeOrBuffer (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:381:5)
      at Writable.write (/code/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:11)

After some investigation these errors don't appar to be hurting
anything, they happen when a record in a layer we don't currently
support is imported. In this case it was the `postalregion` layer.

We could consider supporting that layer in the future, which I think is
also easy, but in the meantime we should at least silence these errors.
@orangejulius orangejulius changed the title fix(import): Catch warning from unsupported hierarchy entries Catch warning from unsupported hierarchy entries Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant