pelias / whosonfirst

Importer for Who's on First gazetteer
MIT License
26 stars 42 forks source link

correctly display string-typed errors #544

Closed missinglink closed 7 months ago

missinglink commented 7 months ago

The errors generated in https://github.com/pelias/whosonfirst/blob/master/src/bundleList.js are of type string, when combined with throwing err.message no error message was printed to the terminal.

This PR improves the error reporting by throwing the original error (if of type Error), else wrapping the string in a new Error object, although the latter method loses stack info.

related https://github.com/pelias/docker/issues/334