Skip to content

Commit

Permalink
Issue #666: add a log message in case FileWrite fails
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Dec 19, 2020
1 parent 15f23fd commit c695bc3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Kernel/System/Package.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4157,13 +4157,22 @@ sub _FileInstall {
}

# write file
return if !$MainObject->FileWrite(
my $FileWriteOk = $MainObject->FileWrite(
Location => $RealFile,
Content => \$Param{File}->{Content},
Mode => 'binmode',
Permission => $Param{File}->{Permission},
);

if ( ! $FileWriteOk ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "Sorry, can't install package because the file $RealFile can't be created.",
);

return;
}

print STDERR "Notice: Install $RealFile ($Param{File}->{Permission})!\n";

return 1;
Expand Down

0 comments on commit c695bc3

Please sign in to comment.