M1-Fix: Exit-Code für ungültige Konfiguration auf 1 geändert
This commit is contained in:
@@ -19,7 +19,7 @@ import de.gecheckt.pdf.umbenenner.application.usecase.NoOpRunBatchProcessingUseC
|
||||
* <p>
|
||||
* AP-005: Integrates configuration loading via PropertiesConfigurationPortAdapter.
|
||||
* <p>
|
||||
* AP-006: Validates configuration before processing begins, returns exit code 2 on invalid config.
|
||||
* AP-006: Validates configuration before processing begins, returns exit code 1 on invalid config.
|
||||
*/
|
||||
public class BootstrapRunner {
|
||||
|
||||
@@ -97,7 +97,7 @@ public class BootstrapRunner {
|
||||
* AP-005: Wires ConfigurationPort adapter and passes it to the use case.
|
||||
* AP-006: Validates configuration before allowing processing to start.
|
||||
*
|
||||
* @return exit code: 0 for success, 1 for unexpected failure, 2 for invalid configuration
|
||||
* @return exit code: 0 for success, 1 for invalid configuration or unexpected failure
|
||||
*/
|
||||
public int run() {
|
||||
LOG.info("Bootstrap flow started.");
|
||||
@@ -129,12 +129,12 @@ public class BootstrapRunner {
|
||||
} catch (InvalidStartConfigurationException e) {
|
||||
// Controlled failure for invalid configuration - log clearly without stack trace
|
||||
LOG.error("Configuration validation failed: {}", e.getMessage());
|
||||
return 2;
|
||||
return 1;
|
||||
} catch (IllegalStateException e) {
|
||||
// Configuration loading failed due to missing/invalid required properties
|
||||
// Treat as invalid configuration for controlled failure
|
||||
LOG.error("Configuration loading failed: {}", e.getMessage());
|
||||
return 2;
|
||||
return 1;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Bootstrap failure during startup.", e);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user