commit e758a96fa6c7746121b7bafcdaa52d639c87e803
parent 46058b2fc9690d32d2eaa7b30753d416fff41b2f
Author: Felicitus <felicitus@felicitus.org>
Date: Sat, 28 Nov 2015 14:27:58 +0100
Use full filename for logging, related to #503
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/PartKeepr/UploadedFileBundle/Controller/FileController.php b/src/PartKeepr/UploadedFileBundle/Controller/FileController.php
@@ -2,6 +2,7 @@
namespace PartKeepr\UploadedFileBundle\Controller;
use Doctrine\ORM\EntityManager;
+use Gaufrette\Adapter\Local;
use Gaufrette\Exception\FileNotFound;
use PartKeepr\UploadedFileBundle\Entity\UploadedFile;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
@@ -61,9 +62,11 @@ abstract class FileController extends Controller
array("Content-Type" => $file->getMimeType())
);
} catch (FileNotFound $e) {
- $this->get("logger")->addError(sprintf("File %s not found in storage %s", $file->getFilename(),
+ $this->get("logger")->addError(
+ sprintf("File %s not found in storage %s", $file->getFullFilename(),
$file->getType()));
+
return new Response(
"404 File not found",
404