Skip to content

Commit

Permalink
Merge pull request #55 from ksdperera/master
Browse files Browse the repository at this point in the history
Fix the SecureVault bundle activator exception handling issue
  • Loading branch information
NisalaNiroshana committed Sep 11, 2018
2 parents 960e3a5 + ff567a8 commit db62731
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ public class SecureVaultActivator implements BundleActivator {

@Override
public void start(BundleContext bundleContext) throws Exception {
SecureVaultDataHolder.getInstance().setBundleContext(bundleContext);
logger.debug("Starting Secure Vault bundle");
logger.debug("Initializing Secure Vault config...");
Path secureVaultYAMLPath = Utils.getRuntimeConfigPath().resolve(Constants.DEPLOYMENT_CONFIG_YAML);
SecureVaultDataHolder.getInstance().setSecureVaultConfiguration(SecureVaultUtils.getSecureVaultConfig
(secureVaultYAMLPath).orElseThrow(() -> new SecureVaultException("Error occurred when obtaining " +
"secure vault configuration.")));
logger.debug("Secure vault config successfully initialized");
try {
SecureVaultDataHolder.getInstance().setBundleContext(bundleContext);
logger.debug("Starting Secure Vault bundle");
logger.debug("Initializing Secure Vault config...");
Path secureVaultYAMLPath = Utils.getRuntimeConfigPath().resolve(Constants.DEPLOYMENT_CONFIG_YAML);
SecureVaultDataHolder.getInstance().setSecureVaultConfiguration(SecureVaultUtils.getSecureVaultConfig
(secureVaultYAMLPath).orElseThrow(() -> new SecureVaultException("Error occurred when obtaining " +
"secure vault configuration.")));
logger.debug("Secure vault config successfully initialized");
} catch (Throwable throwable) {
logger.error("Error occurred when initializing secure vault.", throwable);
throw new SecureVaultException("Error occurred when initializing secure vault.", throwable);
}
}

@Override
Expand Down

0 comments on commit db62731

Please sign in to comment.