Commit 23f0333f authored by Carsten  Rose's avatar Carsten Rose
Browse files

Add '@' to various IO function to suppress OS exception - now QFQ will report customized messages.

parent 07b73555
Pipeline #2629 passed with stages
in 3 minutes and 6 seconds
......@@ -247,9 +247,9 @@ class HelperFile {
public static function chmod($pathFileName, $mode = false) {
if ($mode !== false) {
if (false === chmod($pathFileName, $mode)) {
if (false === @chmod($pathFileName, $mode)) {
throw new \UserFormException(
json_encode([ERROR_MESSAGE_TO_USER => 'Failed: chmod', ERROR_MESSAGE_TO_DEVELOPER => "Failed: chmod $mode '$pathFileName'"]),
json_encode([ERROR_MESSAGE_TO_USER => 'Failed: chmod', ERROR_MESSAGE_TO_DEVELOPER => self::errorGetLastAsString()]),
ERROR_IO_CHMOD);
}
}
......@@ -277,7 +277,7 @@ class HelperFile {
*/
public static function chdir($cwd) {
if (false === chdir($cwd)) {
if (false === @chdir($cwd)) {
$msg = self::errorGetLastAsString() . " - chdir($cwd)";
throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'chdir failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_CHDIR);
}
......@@ -300,7 +300,7 @@ class HelperFile {
Logger::logMessageWithPrefix("Unlink: $filename", $logFilename);
}
if (false === unlink($filename)) {
if (false === @unlink($filename)) {
$msg = self::errorGetLastAsString() . " - unlink($filename)";
throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'unlink failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_UNLINK);
}
......@@ -317,7 +317,7 @@ class HelperFile {
*/
public static function rmdir($tempDir) {
if (false === rmdir($tempDir)) {
if (false === @rmdir($tempDir)) {
$msg = self::errorGetLastAsString() . " - rmdir($tempDir)";
throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'rmdir failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_RMDIR);
}
......@@ -335,7 +335,7 @@ class HelperFile {
*/
public static function rename($oldname, $newname) {
if (false === rename($oldname, $newname)) {
if (false === @rename($oldname, $newname)) {
$msg = self::errorGetLastAsString() . " - rename($oldname ,$newname)";
throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'unlink failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_RENAME);
}
......@@ -358,7 +358,7 @@ class HelperFile {
touch($dest);
}
if (false === copy($source, $dest)) {
if (false === @copy($source, $dest)) {
if (!is_readable($source)) {
throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'copy failed', ERROR_MESSAGE_TO_DEVELOPER => "Can't read file '$source'"]), ERROR_IO_READ_FILE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment