summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-07-23 13:01:11 +0000
committerThierry Vignaud <tv@mandriva.org>2009-07-23 13:01:11 +0000
commit3750ad0aa8fa9c528a4d8f14b16720f09b9cff22 (patch)
tree472ccf18bc36bc5a7aabd86d65f8220bc2ecf1cf
parentde17895895b20c4acdf6b0d7cb3e06e43a93d69d (diff)
downloadmgaonline-3750ad0aa8fa9c528a4d8f14b16720f09b9cff22.tar
mgaonline-3750ad0aa8fa9c528a4d8f14b16720f09b9cff22.tar.gz
mgaonline-3750ad0aa8fa9c528a4d8f14b16720f09b9cff22.tar.bz2
mgaonline-3750ad0aa8fa9c528a4d8f14b16720f09b9cff22.tar.xz
mgaonline-3750ad0aa8fa9c528a4d8f14b16720f09b9cff22.zip
(add_restricted_medium) gracefully handle (rare) server issues (#51548)
-rw-r--r--NEWS1
-rwxr-xr-xmdkapplet-restricted-helper9
2 files changed, 9 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 5bf9097a..26b48a8f 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@
o do not display PowerPack but real product name (#52292)
o on MES5, offer to add update media from authenticated server
- mdkapplet
+ o gracefully handle (rare) server issues (#51548)
o if current distribution is no more supported, warn so and offer to
upgrade to latest release
- mdkapplet-upgrade-helper
diff --git a/mdkapplet-restricted-helper b/mdkapplet-restricted-helper
index e774d117..181cf492 100755
--- a/mdkapplet-restricted-helper
+++ b/mdkapplet-restricted-helper
@@ -118,7 +118,14 @@ sub add_restricted_medium {
my $res = get_from("https://my.mandriva.com/rest/authenticate", [ 'username', $email, 'password', $password,
'return', 'userdata' ]);
- my $ref = XML::Simple->new->XMLin($res->{_content});
+ my $ref = eval { XML::Simple->new->XMLin($res->{_content}) };
+ if (my $err = $@) {
+ warn ">> XML error: $err\n";
+ $ref = {
+ code => 1,
+ message => $err,
+ };
+ }
if ($ref->{code} != 0) {
my $in = interactive->vnew;