1
0

Nachbearbeitung: Konfigurationslade- und Parsefehler einheitlich

klassifiziert
This commit is contained in:
2026-04-05 22:57:45 +02:00
parent 9fd6bc469d
commit 00daa9cb74
5 changed files with 106 additions and 17 deletions

View File

@@ -11,6 +11,7 @@ import org.apache.logging.log4j.Logger;
import de.gecheckt.pdf.umbenenner.adapter.in.cli.SchedulerBatchCommand;
import de.gecheckt.pdf.umbenenner.adapter.out.bootstrap.validation.InvalidStartConfigurationException;
import de.gecheckt.pdf.umbenenner.adapter.out.bootstrap.validation.StartConfigurationValidator;
import de.gecheckt.pdf.umbenenner.adapter.out.configuration.ConfigurationLoadingException;
import de.gecheckt.pdf.umbenenner.adapter.out.configuration.PropertiesConfigurationPortAdapter;
import de.gecheckt.pdf.umbenenner.adapter.out.fingerprint.Sha256FingerprintAdapter;
import de.gecheckt.pdf.umbenenner.adapter.out.lock.FilesystemRunLockPortAdapter;
@@ -249,12 +250,12 @@ public class BootstrapRunner {
BatchRunOutcome outcome = command.run(runContext);
runContext.setEndInstant(Instant.now());
return mapOutcomeToExitCode(outcome, runContext);
} catch (ConfigurationLoadingException e) {
LOG.error("Configuration loading failed: {}", e.getMessage());
return 1;
} catch (InvalidStartConfigurationException e) {
LOG.error("Configuration validation failed: {}", e.getMessage());
return 1;
} catch (IllegalStateException e) {
LOG.error("Configuration loading failed: {}", e.getMessage());
return 1;
} catch (DocumentPersistenceException e) {
LOG.error("Persistence operation failed: {}", e.getMessage(), e);
return 1;

View File

@@ -3,6 +3,7 @@ package de.gecheckt.pdf.umbenenner.bootstrap;
import de.gecheckt.pdf.umbenenner.adapter.in.cli.SchedulerBatchCommand;
import de.gecheckt.pdf.umbenenner.adapter.out.bootstrap.validation.InvalidStartConfigurationException;
import de.gecheckt.pdf.umbenenner.adapter.out.bootstrap.validation.StartConfigurationValidator;
import de.gecheckt.pdf.umbenenner.adapter.out.configuration.ConfigurationLoadingException;
import de.gecheckt.pdf.umbenenner.application.config.startup.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.port.in.BatchRunOutcome;
import de.gecheckt.pdf.umbenenner.application.port.in.BatchRunProcessingUseCase;
@@ -81,7 +82,7 @@ class BootstrapRunnerTest {
@Test
void run_returnsOneOnConfigurationLoadingFailure() {
ConfigurationPort failingConfigPort = () -> {
throw new IllegalStateException("Simulated configuration loading failure");
throw new ConfigurationLoadingException("Simulated configuration loading failure");
};
BootstrapRunner runner = new BootstrapRunner(