fix: removed generic runtime exception

This commit is contained in:
filippo-ferrari 2024-09-15 15:13:21 +02:00
parent 5b067d79ad
commit 0d0030e52f
4 changed files with 4 additions and 4 deletions

View file

@ -121,7 +121,7 @@ public class CategoriesView extends Div implements BeforeEnterObserver {
delete.addClickListener(e -> { delete.addClickListener(e -> {
try { try {
if (this.category == null) throw new RuntimeException("Category is null!"); //TODO: create proper exception if (this.category == null) throw new IllegalStateException("Category is null!");
categoryService.delete(this.category); categoryService.delete(this.category);
clearForm(); clearForm();
refreshGrid(); refreshGrid();

View file

@ -203,7 +203,7 @@ public class ExpensesView extends Div implements BeforeEnterObserver {
delete.addClickListener(e -> { delete.addClickListener(e -> {
try { try {
if (Objects.isNull(this.expense)) throw new RuntimeException("Expense is null!"); //TODO: create proper exception if (Objects.isNull(this.expense)) throw new IllegalStateException("Expense is null!");
expenseService.delete(this.expense.getId()); expenseService.delete(this.expense.getId());
clearForm(); clearForm();
refreshGrid(); refreshGrid();

View file

@ -168,7 +168,7 @@ public class PeopleView extends Div implements BeforeEnterObserver {
delete.addClickListener(e -> { delete.addClickListener(e -> {
try { try {
if (this.person == null) throw new RuntimeException("The person is null!"); //TODO: create proper exception if (this.person == null) throw new IllegalStateException("The person is null!");
personFacade.delete(this.person.getId()); personFacade.delete(this.person.getId());
clearForm(); clearForm();
refreshGrid(); refreshGrid();

View file

@ -130,7 +130,7 @@ public class UsersView extends Div implements BeforeEnterObserver {
delete.addClickListener(e -> { delete.addClickListener(e -> {
try { try {
if (this.user == null) throw new RuntimeException("The user is null!"); //TODO: create proper exception if (this.user == null) throw new IllegalStateException("The user is null!");
userService.delete(this.user); userService.delete(this.user);
clearForm(); clearForm();
refreshGrid(); refreshGrid();