feat: log upload handler errors
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Model\UploadDto;
|
||||
use App\Model\UploadSessionDto;
|
||||
use App\Service\Pdf\Sanitizer;
|
||||
use Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Filesystem\Exception\IOException;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
@@ -20,6 +21,7 @@ class UploadHandler
|
||||
private readonly RequestStack $requestStack,
|
||||
private readonly OrphanageManager $orphanageManager,
|
||||
private readonly Sanitizer $sanitizer,
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly string $projectDir
|
||||
) {
|
||||
}
|
||||
@@ -102,6 +104,7 @@ class UploadHandler
|
||||
try {
|
||||
$filesystem->remove($filepath);
|
||||
} catch (IOException $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,6 +153,7 @@ class UploadHandler
|
||||
;
|
||||
}
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user