try {
bundle.start();
final String message = String.format("Started bundle %s %s",
bundle.getHeaders().get(Constants.BUNDLE_NAME), bundle.getVersion());
responseHelper.flashSuccessMessage(message);
return new RedirectResolution(Urls.BUNDLES);
} catch (final BundleException e) {
responseHelper.flashErrorMessage(String.format("Error starting Bundle: %s", e.getMessage()));
return new RedirectToBundle(bundle);
}
} else {
responseHelper.flashErrorMessage(String.format("Cannot start bundle. Bundle with ID %d not found.", id));
return new RedirectResolution("/dynamic-extensions/bundles");
}
}