Add callback for error notifications on renderStill()
The callback will be called when any of the resources requested from the network failed to load. There is not recovery implemented yet, so the closest thing to reseting the Map object and reloading all the resources would be setting a new style.
This commit is contained in:
@@ -130,4 +130,20 @@ void ResourceLoader::emitTileDataChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
void ResourceLoader::emitResourceLoadingFailed(std::exception_ptr error) {
|
||||
assert(Environment::currentlyOn(ThreadType::Map));
|
||||
|
||||
try {
|
||||
if (error) {
|
||||
std::rethrow_exception(error);
|
||||
}
|
||||
} catch(const std::exception& e) {
|
||||
Log::Error(Event::ResourceLoader, e.what());
|
||||
}
|
||||
|
||||
if (observer_) {
|
||||
observer_->onResourceLoadingFailed(error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user