yandex: Check for presence of success, not lack of error

This is more resilient to bugs.
This commit is contained in:
Richard Hansen 2024-07-21 04:02:37 -04:00
parent f807ba58ac
commit 459970c5e3

View file

@ -6259,7 +6259,7 @@ sub nic_yandex_update {
# Strip header
$reply =~ s/^.*?\n\n//s;
my $response = eval { decode_json($reply) };
if ($response->{success} eq 'error') {
if ($response->{success} ne 'ok') {
failed("%s", $response->{error});
next;
}
@ -6296,7 +6296,7 @@ sub nic_yandex_update {
# Strip header
$reply =~ s/^.*?\n\n//s;
$response = eval { decode_json($reply) };
if ($response->{success} eq 'error') {
if ($response->{success} ne 'ok') {
failed("%s", $response->{error});
next;
}