summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-04-15 11:45:26 -0400
committerKonstantin Käfer <mail@kkaefer.com>2014-04-15 11:45:26 -0400
commit8e442411b0339072666f2b434963a0bd88215f3d (patch)
treec24c788238088fb4e0a536761fff97878253002e /linux
parente9db888491d658e7f722364f38b89cc111bee087 (diff)
downloadqtlocation-mapboxgl-8e442411b0339072666f2b434963a0bd88215f3d.tar.gz
add human-readable error messages
Diffstat (limited to 'linux')
-rw-r--r--linux/request.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/request.cpp b/linux/request.cpp
index 5581957604..617ee5e063 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);
}