mapbox / mapbox/mapnik-omnivore

Don't swallow error messages

Open
#125 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
44
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Debugging a Mapbox Studio Classic and a KML problem, I came across this error message

![image](https://cloud.githubusercontent.com/assets/4549888/10304444/7787acfa-6c1a-11e5-9bd5-6838490606b6.png)

which led me to believe the data was faulty and investigate in that direction, when in reality it seems that in the context of Mapbox Studio Classic and KMLs `mapnik-omnivore`/`node-srs`/`node-gdal` are not able to find the gdal support files:

![image](https://cloud.githubusercontent.com/assets/4549888/10304488/d4e4eb10-6c1a-11e5-96d8-e2d6ee68bd2d.png)

May I suggest to augment the custom error message with the original error message?
e.g. change

``` js
return invalid('OGR source missing extent');
```

to

``` js
return invalid('OGR source missing extent: ' + err);
```

https://github.com/mapbox/mapnik-omnivore/blob/ce7f47af9135acdc144991d5ba27469d76e5649f/lib/ogr.js#L55

/cc @GretaCB

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read lib/ogr.js at the referenced line around the invalid('OGR source missing extent') call and trace the original error value available there. Preserve that original message in the custom error, then verify that the reported OGR error includes the underlying GDAL failure rather than only the generic extent message.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.