[gnome-online-accounts/wip/pocket: 4/4] oauth2: Make the errors consistent



commit 9a3361d00e50364da495366bf7aa1333629fdbef
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Dec 20 19:29:34 2013 +0100

    oauth2: Make the errors consistent
    
    The colon works better than the previous format for error messages
    which can be a few words long.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704564

 src/goabackend/goaoauth2provider.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index fdb0bf9..494b8d3 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -940,7 +940,12 @@ on_web_view_navigation_policy_decision_requested (WebKitWebView             *web
 
       url = soup_uri_to_string (uri, FALSE);
       if (!goa_oauth2_provider_process_redirect_url (provider, url, &priv->access_token, &priv->error))
-        response_id = GTK_RESPONSE_CLOSE;
+        {
+          g_prefix_error (priv->error, _("Authorization response: "));
+          priv->error->domain = GOA_ERROR;
+          priv->error->code = GOA_ERROR_NOT_AUTHORIZED;
+          response_id = GTK_RESPONSE_CLOSE;
+        }
       else
         response_id = GTK_RESPONSE_OK;
 
@@ -1006,7 +1011,7 @@ on_web_view_navigation_policy_decision_requested (WebKitWebView             *web
       g_set_error (&priv->error,
                    GOA_ERROR,
                    GOA_ERROR_NOT_AUTHORIZED,
-                   _("Authorization response was ā€˜%sā€™"),
+                   _("Authorization response: %s"),
                    oauth2_error);
       response_id = GTK_RESPONSE_CLOSE;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]