File upload logging for dummies

This commit is contained in:
Mikael Nordfeldth 2016-03-05 00:59:39 +01:00
parent a9bdf761e8
commit 952f68fed5
2 changed files with 3 additions and 2 deletions

View File

@ -36,6 +36,7 @@ class FileNotFoundException extends ServerException
public function __construct($path)
{
$this->path = $path;
common_debug('File not found exception for: '._ve($this->path));
parent::__construct(_('File not found in filesystem.'), 404);
}
}

View File

@ -306,10 +306,10 @@ class MediaFile
$result = copy($stream['uri'], $filepath) && chmod($filepath, 0664);
if (!$result) {
common_log(LOG_ERR, 'File could not be moved (or chmodded) from '._ve($stream['uri']) . ' to ' . _ve($filepath));
// TRANS: Client exception thrown when a file upload operation fails because the file could
// TRANS: not be moved from the temporary folder to the permanent file location.
throw new ClientException(_('File could not be moved to destination directory.' .
$stream['uri'] . ' ' . $filepath));
throw new ClientException(_('File could not be moved to destination directory.' ));
}
}