diff options
Diffstat (limited to 'rest')
-rw-r--r-- | rest/rest-proxy-call.c | 22 | ||||
-rw-r--r-- | rest/rest-proxy.h | 4 |
2 files changed, 24 insertions, 2 deletions
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index 2cd867a..9384b5b 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -753,6 +753,10 @@ prepare_message (RestProxyCall *call, GError **error_out) { g_free (content); g_free (content_type); + g_set_error_literal (error_out, + REST_PROXY_ERROR, + REST_PROXY_ERROR_BINDING_REQUIRED, + "URL is unbound"); return NULL; } @@ -775,6 +779,10 @@ prepare_message (RestProxyCall *call, GError **error_out) if (!set_url (call)) { + g_set_error_literal (error_out, + REST_PROXY_ERROR, + REST_PROXY_ERROR_BINDING_REQUIRED, + "URL is unbound"); return NULL; } @@ -786,8 +794,14 @@ prepare_message (RestProxyCall *call, GError **error_out) g_hash_table_unref (hash); - if (!message) - return NULL; + if (!message) { + g_set_error (error_out, + REST_PROXY_ERROR, + REST_PROXY_ERROR_URL_INVALID, + "URL '%s' is not valid", + priv->url); + return NULL; + } } else { SoupMultipart *mp; @@ -822,6 +836,10 @@ prepare_message (RestProxyCall *call, GError **error_out) if (!set_url (call)) { soup_multipart_free (mp); + g_set_error_literal (error_out, + REST_PROXY_ERROR, + REST_PROXY_ERROR_BINDING_REQUIRED, + "URL is unbound"); return NULL; } diff --git a/rest/rest-proxy.h b/rest/rest-proxy.h index d341403..d882dea 100644 --- a/rest/rest-proxy.h +++ b/rest/rest-proxy.h @@ -97,6 +97,8 @@ struct _RestProxyClass { * @REST_PROXY_ERROR_SSL: SSL * @REST_PROXY_ERROR_IO: Input/Output * @REST_PROXY_ERROR_FAILED: Failure + * @REST_PROXY_ERROR_URL_INVALID: Invalid URL + * @REST_PROXY_ERROR_BINDING_REQUIRED: URL requires binding * @REST_PROXY_ERROR_HTTP_MULTIPLE_CHOICES: HTTP/Multiple choices * @REST_PROXY_ERROR_HTTP_MOVED_PERMANENTLY: HTTP/Moved permanently * @REST_PROXY_ERROR_HTTP_FOUND: HTTP/Found @@ -139,6 +141,8 @@ typedef enum { REST_PROXY_ERROR_SSL, REST_PROXY_ERROR_IO, REST_PROXY_ERROR_FAILED, + REST_PROXY_ERROR_URL_INVALID, + REST_PROXY_ERROR_BINDING_REQUIRED, REST_PROXY_ERROR_HTTP_MULTIPLE_CHOICES = 300, REST_PROXY_ERROR_HTTP_MOVED_PERMANENTLY = 301, |