1 Commits

Author SHA1 Message Date
AUDUL
6ebbdbd63b * Fix File Exceptions integration (#82) 2025-10-08 10:27:17 +02:00
4 changed files with 10 additions and 5 deletions

View File

@@ -1,3 +1,6 @@
# Version 5.4.1
* Fix File Exceptions integration
# Version 5.4.0
* Add possibility to save exceptions in file

View File

@@ -8,6 +8,7 @@ use CodeRhapsodie\DataflowBundle\DependencyInjection\CodeRhapsodieDataflowExtens
use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\BusCompilerPass;
use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\DataflowTypeCompilerPass;
use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\DefaultLoggerCompilerPass;
use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\ExceptionCompilerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
@@ -30,6 +31,7 @@ class CodeRhapsodieDataflowBundle extends Bundle
->addCompilerPass(new DataflowTypeCompilerPass())
->addCompilerPass(new DefaultLoggerCompilerPass())
->addCompilerPass(new BusCompilerPass())
->addCompilerPass(new ExceptionCompilerPass())
;
}
}

View File

@@ -46,10 +46,10 @@ class Configuration implements ConfigurationInterface
->end()
->scalarNode('flysystem_service')
->end()
->validate()
->ifTrue(static fn ($v): bool => $v['type'] === 'file' && !interface_exists('\League\Flysystem\Filesystem'))
->thenInvalid('You need "league/flysystem" to use Dataflow file exception mode.')
->end()
->end()
->validate()
->ifTrue(static fn ($v): bool => $v['type'] === 'file' && !class_exists('\League\Flysystem\Filesystem'))
->thenInvalid('You need "league/flysystem" to use Dataflow file exception mode.')
->end()
->end()
->end()

View File

@@ -25,7 +25,7 @@ class FilesystemExceptionHandler implements ExceptionHandlerInterface
public function find(int $jobId): ?array
{
try {
if (!$this->filesystem->has(\sprintf('dataflow-job-%s.log', $jobId))) {
if (!$this->filesystem->fileExists(\sprintf('dataflow-job-%s.log', $jobId))) {
return [];
}