Skip to content

Commit

Permalink
remove method name from handle_exception calls
Browse files Browse the repository at this point in the history
  • Loading branch information
hannaeko committed Aug 26, 2021
1 parent b32c1b9 commit 63d7148
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lib/Zonemaster/Backend/RPCAPI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sub new {
bless( $self, $type );

if ( ! $params || ! $params->{config} ) {
handle_exception('new', "Missing 'config' parameter");
handle_exception("Missing 'config' parameter");
}

$self->{config} = $params->{config};
Expand All @@ -70,7 +70,7 @@ sub _init_db {
};

if ($@) {
handle_exception('_init_db', "Failed to initialize the [$dbtype] database backend module: [$@]");
handle_exception("Failed to initialize the [$dbtype] database backend module: [$@]");
}
}

Expand Down Expand Up @@ -102,7 +102,7 @@ sub version_info {

};
if ($@) {
handle_exception( 'version_info', $@ );
handle_exception( $@ );
}

return \%ver;
Expand All @@ -115,7 +115,7 @@ sub profile_names {
my %profiles;
eval { %profiles = $self->{config}->PUBLIC_PROFILES };
if ( $@ ) {
handle_exception( 'profile_names', $@ );
handle_exception( $@ );
}

return [ keys %profiles ];
Expand Down Expand Up @@ -156,7 +156,7 @@ sub get_host_by_name {

};
if ($@) {
handle_exception( 'get_host_by_name', $@ );
handle_exception( $@ );
}

return \@adresses;
Expand Down Expand Up @@ -206,7 +206,7 @@ sub get_data_from_parent_zone {
return \%result;
};
if ($@) {
handle_exception( 'get_data_from_parent_zone', $@ );
handle_exception( $@ );
}
elsif ($result) {
return $result;
Expand Down Expand Up @@ -300,7 +300,7 @@ $extra_validators{start_domain_test} = sub {
return @errors;
};
if ($@) {
handle_exception( 'start_domain_test_validate_syntax', $@ );
handle_exception( $@ );
}
else {
return @errors;
Expand Down Expand Up @@ -340,7 +340,7 @@ sub start_domain_test {
$result = $self->{db}->create_new_test( $params->{domain}, $params, $self->{config}->ZONEMASTER_age_reuse_previous_test );
};
if ($@) {
handle_exception( 'start_domain_test', $@ );
handle_exception( $@ );
}

return $result;
Expand All @@ -358,7 +358,7 @@ sub test_progress {
$result = $self->{db}->test_progress( $test_id );
};
if ($@) {
handle_exception( 'test_progress', $@ );
handle_exception( $@ );
}

return $result;
Expand All @@ -378,7 +378,7 @@ sub get_test_params {
$result = $self->{db}->get_test_params( $test_id );
};
if ($@) {
handle_exception( 'get_test_params', $@ );
handle_exception( $@ );
}

return $result;
Expand Down Expand Up @@ -419,7 +419,7 @@ sub get_test_results {

my $previous_locale = $translator->locale;
if ( !$translator->locale( $locale ) ) {
handle_exception( 'get_test_results', "Failed to set locale: $locale" );
handle_exception( "Failed to set locale: $locale" );
}

eval { $translator->data } if $translator; # Provoke lazy loading of translation data
Expand Down Expand Up @@ -478,7 +478,7 @@ sub get_test_results {
$result->{results} = \@zm_results;
};
if ($@) {
handle_exception( 'get_test_results', $@ );
handle_exception( $@ );
}

$translator->locale( $previous_locale );
Expand Down Expand Up @@ -510,7 +510,7 @@ sub get_test_history {
$results = $self->{db}->get_test_history( $params );
};
if ($@) {
handle_exception( 'get_test_history', $@ );
handle_exception( $@ );
}

return $results;
Expand Down Expand Up @@ -539,7 +539,7 @@ sub add_api_user {
}
};
if ($@) {
handle_exception( 'add_api_user', $@ );
handle_exception( $@ );
}

return $result;
Expand Down Expand Up @@ -579,7 +579,7 @@ sub add_batch_job {
$results = $self->{db}->add_batch_job( $params );
};
if ($@) {
handle_exception( 'add_batch_job', $@ );
handle_exception( $@ );
}

return $results;
Expand All @@ -599,7 +599,7 @@ sub get_batch_job_result {
$result = $self->{db}->get_batch_job_result($batch_id);
};
if ($@) {
handle_exception( 'get_batch_job_result', $@ );
handle_exception( $@ );
}

return $result;
Expand Down

0 comments on commit 63d7148

Please sign in to comment.