ENHANCEMENT Added nicer (and more useful) error message if ErrorPage cannot open the error HTML file for writing

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70190 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-01-15 02:51:29 +00:00 committed by Sam Minnee
parent ec5ed83512
commit ebd5087b31

View File

@ -113,6 +113,17 @@ class ErrorPage extends Page {
if($fh) {
fwrite($fh, $errorContent);
fclose($fh);
} else {
$fileErrorText = sprintf(
_t(
"ErrorPage.ERRORFILEPROBLEM",
"Error opening file \"%s\" for writing. Please check file permissions."
),
$errorFile
);
FormResponse::status_message($fileErrorText, 'bad');
FormResponse::respond();
return;
}
// Restore the version we're currently connected to.