From ae5a345cc4685bdfd0de6fa73b126b08ec895ae5 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Wed, 30 Sep 2015 10:48:04 -0400 Subject: [PATCH] [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 --- src/mbgl/map/map_context.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index e8d039d83..7647d027f 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -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;