From 415cb78d87331528877a5e5b6fe3da721b623c99 Mon Sep 17 00:00:00 2001 From: JaniruTEC Date: Sat, 10 Apr 2021 23:13:06 +0200 Subject: [PATCH] Renamed errorComponent vars to genericErrorBuilder --- .../ChooseExistingVaultController.java | 8 ++++---- .../CreateNewVaultLocationController.java | 8 ++++---- .../CreateNewVaultPasswordController.java | 12 ++++++------ .../ui/changepassword/ChangePasswordController.java | 8 ++++---- .../ui/migration/MigrationRunController.java | 10 +++++----- .../ui/preferences/GeneralPreferencesController.java | 8 ++++---- .../recoverykey/RecoveryKeyCreationController.java | 8 ++++---- .../RecoveryKeyResetPasswordController.java | 8 ++++---- .../org/cryptomator/ui/unlock/UnlockWorkflow.java | 8 ++++---- 9 files changed, 39 insertions(+), 39 deletions(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java index fc7a7b70c..2136c3197 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java @@ -34,7 +34,7 @@ public class ChooseExistingVaultController implements FxController { private final Stage window; private final Lazy welcomeScene; private final Lazy successScene; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; private final ObjectProperty vaultPath; private final ObjectProperty vault; private final VaultListManager vaultListManager; @@ -43,11 +43,11 @@ public class ChooseExistingVaultController implements FxController { private Image screenshot; @Inject - ChooseExistingVaultController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_WELCOME) Lazy welcomeScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy successScene, GenericErrorComponent.Builder errorComponent, ObjectProperty vaultPath, @AddVaultWizardWindow ObjectProperty vault, VaultListManager vaultListManager, ResourceBundle resourceBundle) { + ChooseExistingVaultController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_WELCOME) Lazy welcomeScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy successScene, GenericErrorComponent.Builder genericErrorBuilder, ObjectProperty vaultPath, @AddVaultWizardWindow ObjectProperty vault, VaultListManager vaultListManager, ResourceBundle resourceBundle) { this.window = window; this.welcomeScene = welcomeScene; this.successScene = successScene; - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; this.vaultPath = vaultPath; this.vault = vault; this.vaultListManager = vaultListManager; @@ -83,7 +83,7 @@ public class ChooseExistingVaultController implements FxController { window.setScene(successScene.get()); } catch (NoSuchFileException e) { LOG.error("Failed to open existing vault.", e); - errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); } } } diff --git a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java index 684e3d9d1..20ed05ce2 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java @@ -43,7 +43,7 @@ public class CreateNewVaultLocationController implements FxController { private final Stage window; private final Lazy chooseNameScene; private final Lazy choosePasswordScene; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; private final LocationPresets locationPresets; private final ObjectProperty vaultPath; private final StringProperty vaultName; @@ -61,11 +61,11 @@ public class CreateNewVaultLocationController implements FxController { public RadioButton customRadioButton; @Inject - CreateNewVaultLocationController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_NAME) Lazy chooseNameScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_PASSWORD) Lazy choosePasswordScene, GenericErrorComponent.Builder errorComponent, LocationPresets locationPresets, ObjectProperty vaultPath, @Named("vaultName") StringProperty vaultName, ResourceBundle resourceBundle) { + CreateNewVaultLocationController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_NAME) Lazy chooseNameScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_PASSWORD) Lazy choosePasswordScene, GenericErrorComponent.Builder genericErrorBuilder, LocationPresets locationPresets, ObjectProperty vaultPath, @Named("vaultName") StringProperty vaultName, ResourceBundle resourceBundle) { this.window = window; this.chooseNameScene = chooseNameScene; this.choosePasswordScene = choosePasswordScene; - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; this.locationPresets = locationPresets; this.vaultPath = vaultPath; this.vaultName = vaultName; @@ -129,7 +129,7 @@ public class CreateNewVaultLocationController implements FxController { warningText.set(resourceBundle.getString("addvaultwizard.new.locationDoesNotExist")); } catch (IOException e) { LOG.error("Failed to create and delete directory at chosen vault path.", e); - errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); } } diff --git a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultPasswordController.java b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultPasswordController.java index aa76a5596..f64fb49af 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultPasswordController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultPasswordController.java @@ -53,7 +53,7 @@ public class CreateNewVaultPasswordController implements FxController { private final Lazy chooseLocationScene; private final Lazy recoveryKeyScene; private final Lazy successScene; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; private final ExecutorService executor; private final RecoveryKeyFactory recoveryKeyFactory; private final StringProperty vaultNameProperty; @@ -73,12 +73,12 @@ public class CreateNewVaultPasswordController implements FxController { public Toggle skipRecoveryKey; @Inject - CreateNewVaultPasswordController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_LOCATION) Lazy chooseLocationScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_RECOVERYKEY) Lazy recoveryKeyScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy successScene, GenericErrorComponent.Builder errorComponent, ExecutorService executor, RecoveryKeyFactory recoveryKeyFactory, @Named("vaultName") StringProperty vaultName, ObjectProperty vaultPath, @AddVaultWizardWindow ObjectProperty vault, @Named("recoveryKey") StringProperty recoveryKey, VaultListManager vaultListManager, ResourceBundle resourceBundle, @Named("newPassword") ObjectProperty password, ReadmeGenerator readmeGenerator) { + CreateNewVaultPasswordController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_LOCATION) Lazy chooseLocationScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_RECOVERYKEY) Lazy recoveryKeyScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy successScene, GenericErrorComponent.Builder genericErrorBuilder, ExecutorService executor, RecoveryKeyFactory recoveryKeyFactory, @Named("vaultName") StringProperty vaultName, ObjectProperty vaultPath, @AddVaultWizardWindow ObjectProperty vault, @Named("recoveryKey") StringProperty recoveryKey, VaultListManager vaultListManager, ResourceBundle resourceBundle, @Named("newPassword") ObjectProperty password, ReadmeGenerator readmeGenerator) { this.window = window; this.chooseLocationScene = chooseLocationScene; this.recoveryKeyScene = recoveryKeyScene; this.successScene = successScene; - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; this.executor = executor; this.recoveryKeyFactory = recoveryKeyFactory; this.vaultNameProperty = vaultName; @@ -113,7 +113,7 @@ public class CreateNewVaultPasswordController implements FxController { Files.createDirectory(pathToVault); } catch (IOException e) { LOG.error("Failed to create vault directory.", e); - errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); return; } @@ -138,7 +138,7 @@ public class CreateNewVaultPasswordController implements FxController { window.setScene(recoveryKeyScene.get()); }).onError(IOException.class, e -> { LOG.error("Failed to initialize vault.", e); - errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); }).andFinally(() -> { processing.set(false); }).runOnce(executor); @@ -154,7 +154,7 @@ public class CreateNewVaultPasswordController implements FxController { window.setScene(successScene.get()); }).onError(IOException.class, e -> { LOG.error("Failed to initialize vault.", e); - errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); }).andFinally(() -> { processing.set(false); }).runOnce(executor); diff --git a/main/ui/src/main/java/org/cryptomator/ui/changepassword/ChangePasswordController.java b/main/ui/src/main/java/org/cryptomator/ui/changepassword/ChangePasswordController.java index 2a144898c..999211b1c 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/changepassword/ChangePasswordController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/changepassword/ChangePasswordController.java @@ -34,7 +34,7 @@ public class ChangePasswordController implements FxController { private final Stage window; private final Vault vault; private final ObjectProperty newPassword; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; private final KeychainManager keychain; public NiceSecurePasswordField oldPasswordField; @@ -42,11 +42,11 @@ public class ChangePasswordController implements FxController { public Button finishButton; @Inject - public ChangePasswordController(@ChangePasswordWindow Stage window, @ChangePasswordWindow Vault vault, @Named("newPassword") ObjectProperty newPassword, GenericErrorComponent.Builder errorComponent, KeychainManager keychain) { + public ChangePasswordController(@ChangePasswordWindow Stage window, @ChangePasswordWindow Vault vault, @Named("newPassword") ObjectProperty newPassword, GenericErrorComponent.Builder genericErrorBuilder, KeychainManager keychain) { this.window = window; this.vault = vault; this.newPassword = newPassword; - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; this.keychain = keychain; } @@ -72,7 +72,7 @@ public class ChangePasswordController implements FxController { updatePasswordInSystemkeychain(); } catch (IOException e) { LOG.error("IO error occured during password change. Unable to perform operation.", e); - errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); } catch (InvalidPassphraseException e) { Animations.createShakeWindowAnimation(window).play(); oldPasswordField.selectAll(); diff --git a/main/ui/src/main/java/org/cryptomator/ui/migration/MigrationRunController.java b/main/ui/src/main/java/org/cryptomator/ui/migration/MigrationRunController.java index 621939840..891fa7817 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/migration/MigrationRunController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/migration/MigrationRunController.java @@ -56,7 +56,7 @@ public class MigrationRunController implements FxController { private final ScheduledExecutorService scheduler; private final KeychainManager keychain; private final ObjectProperty missingCapability; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; private final Lazy startScene; private final Lazy successScene; private final Lazy impossibleScene; @@ -68,14 +68,14 @@ public class MigrationRunController implements FxController { public NiceSecurePasswordField passwordField; @Inject - public MigrationRunController(@MigrationWindow Stage window, @MigrationWindow Vault vault, ExecutorService executor, ScheduledExecutorService scheduler, KeychainManager keychain, @Named("capabilityErrorCause") ObjectProperty missingCapability, @FxmlScene(FxmlFile.MIGRATION_START) Lazy startScene, @FxmlScene(FxmlFile.MIGRATION_SUCCESS) Lazy successScene, @FxmlScene(FxmlFile.MIGRATION_CAPABILITY_ERROR) Lazy capabilityErrorScene, @FxmlScene(FxmlFile.MIGRATION_IMPOSSIBLE) Lazy impossibleScene, GenericErrorComponent.Builder errorComponent) { + public MigrationRunController(@MigrationWindow Stage window, @MigrationWindow Vault vault, ExecutorService executor, ScheduledExecutorService scheduler, KeychainManager keychain, @Named("capabilityErrorCause") ObjectProperty missingCapability, @FxmlScene(FxmlFile.MIGRATION_START) Lazy startScene, @FxmlScene(FxmlFile.MIGRATION_SUCCESS) Lazy successScene, @FxmlScene(FxmlFile.MIGRATION_CAPABILITY_ERROR) Lazy capabilityErrorScene, @FxmlScene(FxmlFile.MIGRATION_IMPOSSIBLE) Lazy impossibleScene, GenericErrorComponent.Builder genericErrorBuilder) { this.window = window; this.vault = vault; this.executor = executor; this.scheduler = scheduler; this.keychain = keychain; this.missingCapability = missingCapability; - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; this.startScene = startScene; this.successScene = successScene; this.migrateButtonContentDisplay = Bindings.createObjectBinding(this::getMigrateButtonContentDisplay, vault.stateProperty()); @@ -136,12 +136,12 @@ public class MigrationRunController implements FxController { }).onError(FileNameTooLongException.class, e -> { LOG.error("Migration failed because the underlying file system does not support long filenames.", e); vault.setState(VaultState.NEEDS_MIGRATION); - errorComponent.cause(e).window(window).returnToScene(startScene.get()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(startScene.get()).build().showErrorScene(); window.setScene(impossibleScene.get()); }).onError(Exception.class, e -> { // including RuntimeExceptions LOG.error("Migration failed for technical reasons.", e); vault.setState(VaultState.NEEDS_MIGRATION); - errorComponent.cause(e).window(window).returnToScene(startScene.get()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(startScene.get()).build().showErrorScene(); }).andFinally(() -> { passwordField.setDisable(false); progressSyncTask.cancel(true); diff --git a/main/ui/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java b/main/ui/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java index 5258d9364..f470e6890 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java @@ -49,7 +49,7 @@ public class GeneralPreferencesController implements FxController { private final Application application; private final Environment environment; private final Set keychainAccessProviders; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; public ChoiceBox themeChoiceBox; public ChoiceBox keychainBackendChoiceBox; public CheckBox showMinimizeButtonCheckbox; @@ -63,7 +63,7 @@ public class GeneralPreferencesController implements FxController { @Inject - GeneralPreferencesController(@PreferencesWindow Stage window, Settings settings, TrayMenuComponent trayMenu, Optional autoStartProvider, Set keychainAccessProviders, ObjectProperty selectedTabProperty, LicenseHolder licenseHolder, ResourceBundle resourceBundle, Application application, Environment environment, GenericErrorComponent.Builder errorComponent) { + GeneralPreferencesController(@PreferencesWindow Stage window, Settings settings, TrayMenuComponent trayMenu, Optional autoStartProvider, Set keychainAccessProviders, ObjectProperty selectedTabProperty, LicenseHolder licenseHolder, ResourceBundle resourceBundle, Application application, Environment environment, GenericErrorComponent.Builder genericErrorBuilder) { this.window = window; this.settings = settings; this.trayMenuInitialized = trayMenu.isInitialized(); @@ -75,7 +75,7 @@ public class GeneralPreferencesController implements FxController { this.resourceBundle = resourceBundle; this.application = application; this.environment = environment; - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; } @FXML @@ -146,7 +146,7 @@ public class GeneralPreferencesController implements FxController { } catch (ToggleAutoStartFailedException e) { autoStartCheckbox.setSelected(!enableAutoStart); // restore previous state LOG.error("Failed to toggle autostart.", e); - errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); } }); } diff --git a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java index 7f8025436..0c2610371 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java @@ -32,18 +32,18 @@ public class RecoveryKeyCreationController implements FxController { private final ExecutorService executor; private final RecoveryKeyFactory recoveryKeyFactory; private final StringProperty recoveryKeyProperty; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; public NiceSecurePasswordField passwordField; @Inject - public RecoveryKeyCreationController(@RecoveryKeyWindow Stage window, @FxmlScene(FxmlFile.RECOVERYKEY_SUCCESS) Lazy successScene, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, GenericErrorComponent.Builder errorComponent) { + public RecoveryKeyCreationController(@RecoveryKeyWindow Stage window, @FxmlScene(FxmlFile.RECOVERYKEY_SUCCESS) Lazy successScene, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, GenericErrorComponent.Builder genericErrorBuilder) { this.window = window; this.successScene = successScene; this.vault = vault; this.executor = executor; this.recoveryKeyFactory = recoveryKeyFactory; this.recoveryKeyProperty = recoveryKey; - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; } @FXML @@ -62,7 +62,7 @@ public class RecoveryKeyCreationController implements FxController { Animations.createShakeWindowAnimation(window).play(); } else { LOG.error("Creation of recovery key failed.", task.getException()); - errorComponent.cause(task.getException()).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(task.getException()).window(window).returnToScene(window.getScene()).build().showErrorScene(); } }); executor.submit(task); diff --git a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyResetPasswordController.java b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyResetPasswordController.java index f93e0f126..accc46ea4 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyResetPasswordController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyResetPasswordController.java @@ -35,10 +35,10 @@ public class RecoveryKeyResetPasswordController implements FxController { private final ObjectProperty newPassword; private final Lazy recoverScene; private final BooleanBinding invalidNewPassword; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; @Inject - public RecoveryKeyResetPasswordController(@RecoveryKeyWindow Stage window, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, @Named("newPassword") ObjectProperty newPassword, @FxmlScene(FxmlFile.RECOVERYKEY_RECOVER) Lazy recoverScene, GenericErrorComponent.Builder errorComponent) { + public RecoveryKeyResetPasswordController(@RecoveryKeyWindow Stage window, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, @Named("newPassword") ObjectProperty newPassword, @FxmlScene(FxmlFile.RECOVERYKEY_RECOVER) Lazy recoverScene, GenericErrorComponent.Builder genericErrorBuilder) { this.window = window; this.vault = vault; this.recoveryKeyFactory = recoveryKeyFactory; @@ -47,7 +47,7 @@ public class RecoveryKeyResetPasswordController implements FxController { this.newPassword = newPassword; this.recoverScene = recoverScene; this.invalidNewPassword = Bindings.createBooleanBinding(this::isInvalidNewPassword, newPassword); - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; } @FXML @@ -68,7 +68,7 @@ public class RecoveryKeyResetPasswordController implements FxController { }); task.setOnFailed(event -> { LOG.error("Resetting password failed.", task.getException()); - errorComponent.cause(task.getException()).window(window).returnToScene(recoverScene.get()).build().showErrorScene(); + genericErrorBuilder.cause(task.getException()).window(window).returnToScene(recoverScene.get()).build().showErrorScene(); }); executor.submit(task); } diff --git a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java index f96f14f99..efac020ea 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java +++ b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java @@ -57,10 +57,10 @@ public class UnlockWorkflow extends Task { private final Lazy unlockScene; private final Lazy successScene; private final Lazy invalidMountPointScene; - private final GenericErrorComponent.Builder errorComponent; + private final GenericErrorComponent.Builder genericErrorBuilder; @Inject - UnlockWorkflow(@UnlockWindow Stage window, @UnlockWindow Vault vault, VaultService vaultService, AtomicReference password, @Named("savePassword") AtomicBoolean savePassword, @Named("savedPassword") Optional savedPassword, UserInteractionLock passwordEntryLock, KeychainManager keychain, @FxmlScene(FxmlFile.UNLOCK) Lazy unlockScene, @FxmlScene(FxmlFile.UNLOCK_SUCCESS) Lazy successScene, @FxmlScene(FxmlFile.UNLOCK_INVALID_MOUNT_POINT) Lazy invalidMountPointScene, GenericErrorComponent.Builder errorComponent) { + UnlockWorkflow(@UnlockWindow Stage window, @UnlockWindow Vault vault, VaultService vaultService, AtomicReference password, @Named("savePassword") AtomicBoolean savePassword, @Named("savedPassword") Optional savedPassword, UserInteractionLock passwordEntryLock, KeychainManager keychain, @FxmlScene(FxmlFile.UNLOCK) Lazy unlockScene, @FxmlScene(FxmlFile.UNLOCK_SUCCESS) Lazy successScene, @FxmlScene(FxmlFile.UNLOCK_INVALID_MOUNT_POINT) Lazy invalidMountPointScene, GenericErrorComponent.Builder genericErrorBuilder) { this.window = window; this.vault = vault; this.vaultService = vaultService; @@ -72,7 +72,7 @@ public class UnlockWorkflow extends Task { this.unlockScene = unlockScene; this.successScene = successScene; this.invalidMountPointScene = invalidMountPointScene; - this.errorComponent = errorComponent; + this.genericErrorBuilder = genericErrorBuilder; setOnFailed(event -> { Throwable throwable = event.getSource().getException(); @@ -196,7 +196,7 @@ public class UnlockWorkflow extends Task { private void handleGenericError(Throwable e) { LOG.error("Unlock failed for technical reasons.", e); - errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); + genericErrorBuilder.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene(); } private void wipePassword(char[] pw) {