use of io.imunity.furms.api.validation.exceptions.SiteHasResourceCreditsRemoveValidationError in project furms by unity-idm.
the class SitesView method actionDeleteSite.
private void actionDeleteSite(SiteGridItem site, Grid<SiteGridItem> siteGrid) {
FurmsDialog cancelDialog = new FurmsDialog(getTranslation("view.sites.main.confirmation.dialog.delete", site.getName()));
cancelDialog.addConfirmButtonClickListener(event -> {
try {
siteService.delete(site.getId());
showSuccessNotification(getTranslation("view.sites.main.grid.item.menu.delete.success", site.getName()));
} catch (SiteHasResourceCreditsRemoveValidationError e) {
LOG.debug("Could not create Site. ", e);
showErrorNotification(getTranslation("site.removing.error.message", site.getName()));
} catch (RuntimeException e) {
LOG.warn("Could not create Site. ", e);
showErrorNotification(getTranslation("view.sites.form.error.unexpected", "delete"));
} finally {
siteGrid.setItems(fetchSites());
}
});
cancelDialog.open();
}
Aggregations