[gnome-online-accounts] oauth2: Make the errors consistent



commit f5b66f7d681b4f4a35867c7d9dba556cad820ea0
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 |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index fdb0bf9..928771f 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * Copyright (C) 2011, 2012 Red Hat, Inc.
+ * Copyright (C) 2011, 2012, 2013 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -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]