From d984dcbcd614df7754a159f2e88ba9e004a4129d Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Mon, 10 Nov 2014 18:45:48 +0100 Subject: [PATCH] Improve doPrepareInternal error messages Bug: 73229 Change-Id: Iee6c478d02c3d6f8d5f7d516c799d9bd53b0272f --- includes/filebackend/FSFileBackend.php | 3 +++ languages/i18n/en.json | 2 ++ languages/i18n/qqq.json | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/filebackend/FSFileBackend.php b/includes/filebackend/FSFileBackend.php index b99ffb62e9..9aa4ca82f8 100644 --- a/includes/filebackend/FSFileBackend.php +++ b/includes/filebackend/FSFileBackend.php @@ -451,10 +451,13 @@ class FSFileBackend extends FileBackendStore { // Create the directory and its parents as needed... $this->trapWarnings(); if ( !wfMkdirParents( $dir ) ) { + wfDebugLog( 'FSFileBackend', __METHOD__ . ": cannot create directory $dir" ); $status->fatal( 'directorycreateerror', $params['dir'] ); // fails on races } elseif ( !is_writable( $dir ) ) { + wfDebugLog( 'FSFileBackend', __METHOD__ . ": directory $dir is read-only" ); $status->fatal( 'directoryreadonlyerror', $params['dir'] ); } elseif ( !is_readable( $dir ) ) { + wfDebugLog( 'FSFileBackend', __METHOD__ . ": directory $dir is not readable" ); $status->fatal( 'directorynotreadableerror', $params['dir'] ); } $this->untrapWarnings(); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 341f62634c..0f7705a0ae 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -325,6 +325,8 @@ "filerenameerror": "Could not rename file \"$1\" to \"$2\".", "filedeleteerror": "Could not delete file \"$1\".", "directorycreateerror": "Could not create directory \"$1\".", + "directoryreadonlyerror": "Directory \"$1\" is read-only.", + "directorynotreadableerror": "Directory \"$1\" is not readable.", "filenotfound": "Could not find file \"$1\".", "unexpected": "Unexpected value: \"$1\"=\"$2\".", "formerror": "Error: Could not submit form.", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index b9d586c266..e254fa5f39 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -488,7 +488,9 @@ "filecopyerror": "Parameters:\n* $1 - source file name\n* $2 - destination file name", "filerenameerror": "Parameters:\n* $1 - old file name\n* $2 - new file name", "filedeleteerror": "Parameters:\n* $1 - file name", - "directorycreateerror": "Parameters:\n* $1 - directory name", + "directorycreateerror": "Error message returned when the directory cannot be created. Parameters:\n* $1 - directory name", + "directoryreadonlyerror": "Error message returned when the directory is read-only. Parameters:\n* $1 - directory name", + "directorynotreadableerror": "Error message returned when the directory isn't readable. Parameters:\n* $1 - directory name", "filenotfound": "Parameters:\n* $1 - file name", "unexpected": "This message indicates the value $2 is unexpected for $1. Parameters:\n* $1 - name\n* $2 - value", "formerror": "Generic error message show to a user when they try to submit information that could not be processed for any reason.", -- 2.20.1