diff --git a/linux/request.cpp b/linux/request.cpp index 558195760..617ee5e06 100644 --- a/linux/request.cpp +++ b/linux/request.cpp @@ -101,6 +101,12 @@ void Request::request(void *ptr) { code = curl_easy_perform(curl); curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &res.code); + // Add human-readable error code + if (code != CURLE_OK) { + res.error_message = curl_easy_strerror(code); + res.code = -1; + } + if (code != CURLE_ABORTED_BY_CALLBACK) { req->background_function(&res); } diff --git a/src/map/tile_data.cpp b/src/map/tile_data.cpp index e35fc0645..4df01778d 100644 --- a/src/map/tile_data.cpp +++ b/src/map/tile_data.cpp @@ -58,7 +58,7 @@ void TileData::request() { tile->data.swap(res->body); tile->parse(); } else { - fprintf(stderr, "tile loading failed (%s): %d\n", url.c_str(), res->code); + fprintf(stderr, "[%s] tile loading failed: %d, %s\n", url.c_str(), res->code, res->error_message.c_str()); } }, []() { platform::restart();