[grilo] wc: raise an error when the operation is cancelled
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] wc: raise an error when the operation is cancelled
- Date: Thu, 3 Feb 2011 16:43:01 +0000 (UTC)
commit cf1ab2425d9f4da3b5dfeb3050e2dda7cac3a2f0
Author: VÃctor Manuel Jáquez Leal <vjaquez igalia com>
Date: Thu Feb 3 16:41:06 2011 +0100
wc: raise an error when the operation is cancelled
Signed-off-by: VÃctor Manuel Jáquez Leal <vjaquez igalia com>
libs/net/grl-net-wc.c | 3 +++
libs/net/grl-net-wc.h | 2 ++
2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libs/net/grl-net-wc.c b/libs/net/grl-net-wc.c
index 96922a1..0b6253f 100644
--- a/libs/net/grl-net-wc.c
+++ b/libs/net/grl-net-wc.c
@@ -252,6 +252,9 @@ parse_error (guint status,
response);
return;
case SOUP_STATUS_CANCELLED:
+ g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
+ GRL_NET_WC_ERROR_CANCELLED,
+ "Operation was cancelled");
return;
default:
g_message ("Unhandled status: %s", soup_status_get_phrase (status));
diff --git a/libs/net/grl-net-wc.h b/libs/net/grl-net-wc.h
index fd87f13..71dfd72 100644
--- a/libs/net/grl-net-wc.h
+++ b/libs/net/grl-net-wc.h
@@ -40,6 +40,7 @@ G_BEGIN_DECLS
* @GRL_NET_WC_ERROR_FORBIDDEN: TBD
* @GRL_NET_WC_ERROR_NETWORK_ERROR: Cannot connect to the server
* @GRL_NET_WC_ERROR_PROXY_ERROR: Cannot connect to the proxy server
+ * @GRL_NET_WC_ERROR_CANCELLED: The operation has been cancelled (see #GCancellable)
*
* These constants identify all the available errors managed by
* the web client.
@@ -53,6 +54,7 @@ typedef enum {
GRL_NET_WC_ERROR_FORBIDDEN,
GRL_NET_WC_ERROR_NETWORK_ERROR,
GRL_NET_WC_ERROR_PROXY_ERROR,
+ GRL_NET_WC_ERROR_CANCELLED,
} GrlNetWcError;
#define GRL_TYPE_NET_WC \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]