Unverified Commit d73072b0 authored by Gavin Brown's avatar Gavin Brown
Browse files

return error()

parent 6f0a03c2
...@@ -165,8 +165,7 @@ sub handle_ssl { ...@@ -165,8 +165,7 @@ sub handle_ssl {
note('SSL disabled'); note('SSL disabled');
} else { } else {
error("Invalid SSL mode '%s'", $_[0]); return error("Invalid SSL mode '%s'", $_[0]);
return undef;
} }
return 1; return 1;
...@@ -186,8 +185,7 @@ sub handle_port { ...@@ -186,8 +185,7 @@ sub handle_port {
sub handle_connect { sub handle_connect {
if ($epp->{'host'} eq '') { if ($epp->{'host'} eq '') {
error('No host specified'); return error('No host specified');
return undef;
} else { } else {
note('Connecting to %s', $epp->{'host'}); note('Connecting to %s', $epp->{'host'});
...@@ -198,12 +196,10 @@ sub handle_connect { ...@@ -198,12 +196,10 @@ sub handle_connect {
sub handle_credentials { sub handle_credentials {
if ($_[0] eq '') { if ($_[0] eq '') {
error('Missing client ID'); return error('Missing client ID');
return undef;
} elsif ($_[1] eq '') { } elsif ($_[1] eq '') {
error('Missing password'); return error('Missing password');
return undef;
} else { } else {
handle_id($_[0]); handle_id($_[0]);
...@@ -225,12 +221,10 @@ sub handle_pw { ...@@ -225,12 +221,10 @@ sub handle_pw {
sub handle_login { sub handle_login {
if ($epp->{'host'} eq '') { if ($epp->{'host'} eq '') {
error('No host specified'); return error('No host specified');
return undef;
} elsif ($epp->{'user'} eq '' || $epp->{'pass'} eq '') { } elsif ($epp->{'user'} eq '' || $epp->{'pass'} eq '') {
error('No credentials specified'); return error('No credentials specified');
return undef;
} elsif (!defined($epp->{'connected'})) { } elsif (!defined($epp->{'connected'})) {
return handle_connect() && handle_login(); return handle_connect() && handle_login();
...@@ -243,8 +237,7 @@ sub handle_login { ...@@ -243,8 +237,7 @@ sub handle_login {
sub handle_logout { sub handle_logout {
if (!defined($epp->{'authenticated'})) { if (!defined($epp->{'authenticated'})) {
error('Not logged in'); return error('Not logged in');
return undef;
} else { } else {
note('logging out'); note('logging out');
...@@ -274,8 +267,7 @@ sub handle_check { ...@@ -274,8 +267,7 @@ sub handle_check {
return $epp->check_contact($id); return $epp->check_contact($id);
} else { } else {
error("Unsupported object type '$type'"); return error("Unsupported object type '$type'");
return undef;
} }
} }
...@@ -316,10 +308,7 @@ sub handle_fee_check { ...@@ -316,10 +308,7 @@ sub handle_fee_check {
$ok = 1 if ($el->textContent eq $fee_ns); $ok = 1 if ($el->textContent eq $fee_ns);
} }
if (!$ok) { return error("Server does not support the version of the fee extension that I support!") if (!$ok);
error("Server does not support the version of the fee extension that I support!");
return undef;
}
my $domain = $frame->createElementNS($fee_ns, 'domain'); my $domain = $frame->createElementNS($fee_ns, 'domain');
foreach my $name (qw(name currency command period)) { foreach my $name (qw(name currency command period)) {
...@@ -353,8 +342,7 @@ sub handle_info { ...@@ -353,8 +342,7 @@ sub handle_info {
return $epp->contact_info($id); return $epp->contact_info($id);
} else { } else {
error("Unsupported object type '$type'"); return error("Unsupported object type '$type'");
return undef;
} }
} }
...@@ -497,8 +485,7 @@ sub handle_delete { ...@@ -497,8 +485,7 @@ sub handle_delete {
return $epp->delete_contact($id); return $epp->delete_contact($id);
} else { } else {
error("Unsupported object type '$type'"); return error("Unsupported object type '$type'");
return undef;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment