diff options
author | suve <veg@svgames.pl> | 2017-12-17 11:50:26 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-12-17 11:14:28 +0000 |
commit | 19ec1e9d6585eb647ff4ec65e0b938e4c18dea3b (patch) | |
tree | e3a48b3ed94d4969fbcdbae8963fdcba8e76df2c | |
parent | 6b940d967be1df460fbc60fa24925080abd6393b (diff) | |
download | appstream-glib-19ec1e9d6585eb647ff4ec65e0b938e4c18dea3b.tar.gz |
Describe connection problems/HTTP errors when validating images
-rw-r--r-- | libappstream-glib/as-app-validate.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c index 3c1f75d..8fc95d2 100644 --- a/libappstream-glib/as-app-validate.c +++ b/libappstream-glib/as-app-validate.c @@ -24,6 +24,7 @@ #include <fnmatch.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <libsoup/soup.h> +#include <libsoup/soup-status.h> #include <string.h> #include "as-app-private.h" @@ -471,10 +472,17 @@ ai_app_validate_image_check (AsImage *im, AsAppValidateHelper *helper) /* send sync */ status_code = soup_session_send_message (helper->session, msg); - if (status_code != SOUP_STATUS_OK) { + if (SOUP_STATUS_IS_TRANSPORT_ERROR(status_code)) { ai_app_validate_add (helper, - AS_PROBLEM_KIND_URL_NOT_FOUND, - "<screenshot> url not found [%s]", url); + AS_PROBLEM_KIND_URL_NOT_FOUND, + "<screenshot> failed to connect: %s [%s]", + soup_status_get_phrase(status_code), url); + return FALSE; + } else if (status_code != SOUP_STATUS_OK) { + ai_app_validate_add (helper, + AS_PROBLEM_KIND_URL_NOT_FOUND, + "<screenshot> failed to download (HTTP %d: %s) [%s]", + status_code, soup_status_get_phrase(status_code), url); return FALSE; } |