Skip to content

Commit

Permalink
Move error handling to check_fake_delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTimbert committed Oct 21, 2024
1 parent 45f212b commit 13123ea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/Zonemaster/CLI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,14 @@ sub run {
( my $errors, $domain ) = normalize_name( decode( 'utf8', $domain ) );

if ( $self->ns and @{ $self->ns } > 0 ) {
$self->check_fake_delegation( $domain );
local $@;
eval {
$self->check_fake_delegation( $domain );
1;
} or do {
print STDERR $@;
return $EXIT_USAGE_ERROR;
};
}

if ( $self->ds and @{ $self->ds } ) {
Expand Down Expand Up @@ -685,14 +692,7 @@ sub run {
}

if ( $self->ns and @{ $self->ns } > 0 ) {
local $@;
eval {
$self->add_fake_delegation( $domain );
1;
} or do {
print STDERR $@;
return $EXIT_USAGE_ERROR;
};
$self->add_fake_delegation( $domain );
}

if ( $self->ds and @{ $self->ds } ) {
Expand Down

0 comments on commit 13123ea

Please sign in to comment.