[core] Improve error message when style is not found or is incompatible

Attempting to use a Mapbox-hosted incompatible raster map/style with GL
would throw a simple 404, without any indication of the real issue.

Fix #1724, ref #1841
This commit is contained in:
Jason Wray
2015-09-30 10:48:04 -04:00
parent 21c40f41e8
commit ae5a345cc4

View File

@@ -118,6 +118,8 @@ void MapContext::setStyleURL(const std::string& url) {
if (res.status == Response::Successful) {
loadStyleJSON(res.data, base);
} else if (res.status == Response::NotFound && (styleURL.find("mapbox://") != std::string::npos)) {
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.message.c_str());
data.loading = false;