Notify tile parsing errors

The tile parsing is done in a worker thread and if it fails,
we set the tile state to "obsolete" and set an error message.

When the completion callback is fired, we check for the error
message and if it is set, we emit the error signal.

The trick here is the signal cannot be emitted directly from
the worker thread because that would violate data ownership rules.
This commit is contained in:
Thiago Marcos P. Santos
2015-05-27 18:34:06 +03:00
parent 48875d8d6c
commit f8cc50683a
5 changed files with 50 additions and 19 deletions

View File

@@ -59,9 +59,9 @@ void VectorTileData::parse() {
setState(State::parsed);
}
} catch (const std::exception& ex) {
Log::Error(Event::ParseTile, "Parsing [%d/%d/%d] failed: %s", id.z, id.x, id.y, ex.what());
setState(State::obsolete);
return;
std::stringstream message;
message << "Failed to parse [" << int(id.z) << "/" << id.x << "/" << id.y << "]: " << ex.what();
setError(message.str());
}
}