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