diff --git a/CHANGELOG.md b/CHANGELOG.md index a84d5789..b412c2f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ before. Along the way this fixes a leaked `z_stream` when `compress()` failed and two `exit()` calls that could run from a destructor or from `mvt_value`'s hash function. +* Keep reporting a tile that fails to decode as `EXIT_MVT`, and report why. + Now that decoding failures throw, the `catch` meant for protozero's + exceptions was catching tippecanoe's own as well, replacing their exit + status and message with `EXIT_PROTOBUF` and a generic "PBF decoding + error". * Add `--drop-by-attribute-as-needed=`*attribute* to drop the features with the lowest values of a numeric attribute from oversized tiles, and `--drop-by-attribute-order=desc` to drop the highest values instead. diff --git a/clip.cpp b/clip.cpp index b34998b7..07a99cf6 100644 --- a/clip.cpp +++ b/clip.cpp @@ -1230,6 +1230,10 @@ std::string overzoom(std::vector const &tiles, int nz, int nx, int n if (!tile.decode(t.tile, was_compressed)) { throw_tippecanoe_error(EXIT_MVT, "Couldn't parse tile %d/%u/%u", t.z, t.x, t.y); } + } catch (tippecanoe_error &e) { + // a tippecanoe_error is a std::exception, so it would + // otherwise be caught below and reattributed to protobuf + throw; } catch (std::exception const &e) { throw_tippecanoe_error(EXIT_PROTOBUF, "PBF decoding error in tile %d/%u/%u", t.z, t.x, t.y); } diff --git a/decode.cpp b/decode.cpp index 6211a885..7dadb766 100644 --- a/decode.cpp +++ b/decode.cpp @@ -102,6 +102,10 @@ void handle(std::string message, int z, unsigned x, unsigned y, std::set