Tippecanoe exit codes
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 430
- PR merge metrics
- No merged PRs in 30d
Description
As far as I can see `tippecanoe` only has one exit code (`EXIT_FAILURE`) for all error conditions. This makes it difficult to differentiate between different types of errors in scripts. This came up for me when tippecanoe didn't find any geometries in the input and exited with "Did not read any valid geometries". In my use case this isn't an error at all, I would expect to just get empty vector tiles then. But at the very least I want to be able to check for this.
I suggest using different exit codes for different severities. This is the model I have been moving towards for a while:
* Exit code 3: Fatal errors in config or command line. Always an error of the caller. Will probably happen the same way if the program is called in the same way.
* Exit code 2: Fatal errors because of invalid input, missing files, full file system, etc. These are things often outside the direct control of the caller. If the root cause is fixed, the next call to the program will probably work.
* Exit code 1: Warnings. The program mostly did what it was supposed to do but something special happened. Also used for cases where two distinct valid outputs are used (think of `grep` or `diff`) to mark the "match" and "not match" case, or "okay" and "empty".
* Exit code 0: Everything okay.
There might be several of the "Exit code 1" cases. So maybe more exit codes needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the tippecanoe command entry point, its current exit handling, and the path that reports "Did not read any valid geometries." Review how other fatal and warning conditions are classified. Done means the proposed exit-code distinctions are implemented consistently and the relevant outcomes are covered by tests or documented behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100