mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Try catch exception (#108)
* catch exception when parsing invalid pbf - fixes #817 * updating exit error
This commit is contained in:
+7
-2
@@ -81,8 +81,13 @@ void handle(std::string message, int z, unsigned x, unsigned y, std::map<std::st
|
||||
int features_added = 0;
|
||||
bool was_compressed;
|
||||
|
||||
if (!tile.decode(message, was_compressed)) {
|
||||
fprintf(stderr, "Couldn't decompress tile %d/%u/%u\n", z, x, y);
|
||||
try {
|
||||
if (!tile.decode(message, was_compressed)) {
|
||||
fprintf(stderr, "Couldn't decompress tile %d/%u/%u\n", z, x, y);
|
||||
exit(EXIT_MVT);
|
||||
}
|
||||
} catch (std::exception const &e) {
|
||||
fprintf(stderr, "PBF decoding error in tile %d/%u/%u\n", z, x, y);
|
||||
exit(EXIT_MVT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user