[gnome-online-accounts] lastfm: Log the details of parsing failures as WARNINGs
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] lastfm: Log the details of parsing failures as WARNINGs
- Date: Thu, 3 Aug 2017 15:22:25 +0000 (UTC)
commit 57311e7fef5bb7918ddc470201a8075ee4976d7f
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Aug 2 18:00:14 2017 +0200
lastfm: Log the details of parsing failures as WARNINGs
src/goabackend/goalastfmprovider.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goalastfmprovider.c b/src/goabackend/goalastfmprovider.c
index 92395d9..532ef3c 100644
--- a/src/goabackend/goalastfmprovider.c
+++ b/src/goabackend/goalastfmprovider.c
@@ -225,6 +225,7 @@ lastfm_login_sync (GoaProvider *provider,
json_obj = json_node_get_object (root);
if (!json_object_has_member (json_obj, "session"))
{
+ g_warning ("Did not find session in JSON data");
g_set_error (error, GOA_ERROR, GOA_ERROR_FAILED, _("Could not parse response"));
goto out;
}
@@ -232,11 +233,13 @@ lastfm_login_sync (GoaProvider *provider,
session_obj = json_node_get_object (json_object_get_member (json_obj, "session"));
if (!json_object_has_member (session_obj, "name"))
{
+ g_warning ("Did not find session.name in JSON data");
g_set_error (error, GOA_ERROR, GOA_ERROR_FAILED, _("Could not parse response"));
goto out;
}
if (!json_object_has_member (session_obj, "key"))
{
+ g_warning ("Did not find session.key in JSON data");
g_set_error (error, GOA_ERROR, GOA_ERROR_FAILED, _("Could not parse response"));
goto out;
}
@@ -521,6 +524,7 @@ check_cb (RestProxyCall *call,
json_obj = json_node_get_object (json_parser_get_root (parser));
if (!json_object_has_member (json_obj, "session"))
{
+ g_warning ("Did not find session in JSON data");
g_set_error (&data->error, GOA_ERROR, GOA_ERROR_FAILED, _("Authentication failed"));
goto out;
}
@@ -529,11 +533,13 @@ check_cb (RestProxyCall *call,
session_obj = json_node_get_object (session);
if (!json_object_has_member (session_obj, "name"))
{
+ g_warning ("Did not find session.name in JSON data");
g_set_error (&data->error, GOA_ERROR, GOA_ERROR_FAILED, _("Could not parse response"));
goto out;
}
if (!json_object_has_member (session_obj, "key"))
{
+ g_warning ("Did not find session.key in JSON data");
g_set_error (&data->error, GOA_ERROR, GOA_ERROR_FAILED, _("Could not parse response"));
goto out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]