Fix stop() debug (#2660)

This commit is contained in:
Yadd 2022-02-02 11:08:02 +01:00
parent de79fc49b0
commit 50f25a9116
1 changed files with 6 additions and 4 deletions

View File

@ -293,10 +293,12 @@ sub stop {
#or $res == PE_FORMEMPTY
);
my $ret;
eval { $ret = $mod->( 'stop', $res ) };
if ($@) {
$self->logger->debug( 'Trying to call optional stop: ' . $@ );
return 0;
if ( $mod->( 'can', 'stop' ) ) {
eval { $ret = $mod->( 'stop', $res ) };
if ($@) {
$self->logger->error( 'Optional stop() method failed: ' . $@ );
return 0;
}
}
return $ret;
}