From ebd5087b31fab31110045981abd804e67258bb67 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 15 Jan 2009 02:51:29 +0000 Subject: [PATCH] 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 --- core/model/ErrorPage.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/model/ErrorPage.php b/core/model/ErrorPage.php index 010d806ea..893680ba5 100755 --- a/core/model/ErrorPage.php +++ b/core/model/ErrorPage.php @@ -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.