[core] move retry logic to DefaultFileSource
This commit is contained in:
@@ -112,14 +112,17 @@ void MapContext::setStyleURL(const std::string& url) {
|
||||
}
|
||||
styleRequest = nullptr;
|
||||
|
||||
if (res.status == Response::Successful) {
|
||||
loadStyleJSON(*res.data, base);
|
||||
} else if (res.status == Response::NotFound && styleURL.find("mapbox://") == 0) {
|
||||
Log::Error(Event::Setup, "style %s could not be found or is an incompatible legacy map or style", styleURL.c_str());
|
||||
if (res.error) {
|
||||
if (res.error->reason == Response::Error::Reason::NotFound && styleURL.find("mapbox://") == 0) {
|
||||
Log::Error(Event::Setup, "style %s could not be found or is an incompatible legacy map or style", styleURL.c_str());
|
||||
} else {
|
||||
Log::Error(Event::Setup, "loading style failed: %s", res.error->message.c_str());
|
||||
data.loading = false;
|
||||
}
|
||||
} else {
|
||||
Log::Error(Event::Setup, "loading style failed: %s", res.message.c_str());
|
||||
data.loading = false;
|
||||
loadStyleJSON(*res.data, base);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user