Look at the following code:
public void editProduct(String articleNumber, ...) {
product.setArticleNumber(articleNumber);
product.setDescription(description);
product.setLendable(lendable);
product.setName(name);
product.setPrice(price);
product.setPlace(place);
}
All of the setters can throw a ProductException with a custom message.
But I want to catch all the exceptions. If there are exceptions, I want to send a list to the GUI of all the errors.
How can I do this, or do I need to surround every line with a Try Catch?