summaryrefslogtreecommitdiffstats
path: root/mdkapplet-restricted-helper
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 /mdkapplet-restricted-helper
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)
Diffstat (limited to 'mdkapplet-restricted-helper')
-rwxr-xr-xmdkapplet-restricted-helper9
1 files changed, 8 insertions, 1 deletions
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;