From: Antoine Musso Date: Tue, 11 Jul 2006 20:06:55 +0000 (+0000) Subject: cleaner error message when file cant be wrote X-Git-Tag: 1.31.0-rc.0~56286 X-Git-Url: http://git.cyclocoop.org/%27.%28%24current%20%3E%202?a=commitdiff_plain;h=0e31316f879576730c31fc95219bcabd2e421014;p=lhc%2Fweb%2Fwiklou.git cleaner error message when file cant be wrote --- diff --git a/maintenance/dumpHTML.inc b/maintenance/dumpHTML.inc index 2ed1e4a2c8..6adcb8da08 100644 --- a/maintenance/dumpHTML.inc +++ b/maintenance/dumpHTML.inc @@ -41,7 +41,7 @@ class DumpHTML { # List of raw pages used in the current article var $rawPages; - + # Skin to use var $skin = 'dumphtml'; @@ -265,9 +265,12 @@ class DumpHTML { wfMkdirParents( $fullDir, 0755 ); + wfSuppressWarnings(); $file = fopen( $fullName, 'w' ); + wfRestoreWarnings(); + if ( !$file ) { - print("Can't open file $fullName for writing\n"); + die("Can't open file '$fullName' for writing.\nCheck permissions or use another destination (-d).\n"); return; }