Catch warning from unsupported hierarchy entries - #149
Open
orangejulius wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During an import I noticed an error like the following:
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
postalregionlayer.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.