diff --git a/src/main/java/com/application/munera/views/categories/CategoriesView.java b/src/main/java/com/application/munera/views/categories/CategoriesView.java index 94f0292..a358e11 100644 --- a/src/main/java/com/application/munera/views/categories/CategoriesView.java +++ b/src/main/java/com/application/munera/views/categories/CategoriesView.java @@ -121,7 +121,7 @@ public class CategoriesView extends Div implements BeforeEnterObserver { delete.addClickListener(e -> { 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); clearForm(); refreshGrid(); diff --git a/src/main/java/com/application/munera/views/expenses/ExpensesView.java b/src/main/java/com/application/munera/views/expenses/ExpensesView.java index 2c6ae27..b8ea8a3 100644 --- a/src/main/java/com/application/munera/views/expenses/ExpensesView.java +++ b/src/main/java/com/application/munera/views/expenses/ExpensesView.java @@ -203,7 +203,7 @@ public class ExpensesView extends Div implements BeforeEnterObserver { delete.addClickListener(e -> { 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()); clearForm(); refreshGrid(); diff --git a/src/main/java/com/application/munera/views/people/PeopleView.java b/src/main/java/com/application/munera/views/people/PeopleView.java index e1e6ccb..5408cb1 100644 --- a/src/main/java/com/application/munera/views/people/PeopleView.java +++ b/src/main/java/com/application/munera/views/people/PeopleView.java @@ -168,7 +168,7 @@ public class PeopleView extends Div implements BeforeEnterObserver { delete.addClickListener(e -> { 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()); clearForm(); refreshGrid(); diff --git a/src/main/java/com/application/munera/views/users/UsersView.java b/src/main/java/com/application/munera/views/users/UsersView.java index 010b712..40a046f 100644 --- a/src/main/java/com/application/munera/views/users/UsersView.java +++ b/src/main/java/com/application/munera/views/users/UsersView.java @@ -130,7 +130,7 @@ public class UsersView extends Div implements BeforeEnterObserver { delete.addClickListener(e -> { 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); clearForm(); refreshGrid();