Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught errors when opening a bad file #46

Closed
yocontra opened this issue Dec 16, 2019 · 0 comments · Fixed by #52
Closed

Uncaught errors when opening a bad file #46

yocontra opened this issue Dec 16, 2019 · 0 comments · Fixed by #52

Comments

@yocontra
Copy link
Contributor

yocontra commented Dec 16, 2019

It seems this error type doesn't get caught and bubbled up through the stream, and isn't catchable with a try-catch.

Unable to open datasource `/private/var/folders/4h/83g6gdzn2qbdybd8z251g1lh0000gn/T/61ba5796-8d31-4078-8544-82262525fbae.gdb.zip' with the following drivers.
  -> `PCIDSK'
  -> `netCDF'
  -> `JPEG2000'
  -> `PDF'
  -> `MBTiles'
  ... and so on

Code:

ogr('gdb-empty.zip', 'ESRI Shapefile')
    .format('GeoJSON')
    .project('crs:84')
    .skipfailures()
    .timeout(86400000) // 1 day in ms
    .stream()
	.on('error', (err) => console.error(err))

The process will crash with the uncaught error, instead of catching it in the error event.

gdb-empty.zip

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 a pull request may close this issue.

1 participant