Hi, I'm new to Symfony and struggling to find an elegant solution for handling errors.
I know I can throw Exceptions and make my own Exception classes, but it's how to display the error to the user in the best possible fashion.
For example, I've got a Card class that charges credit and debit cards, there are a variety of different problems that can occur.
So should I make exceptions for the different problems, or use a generic CardException class, but where should I save the actual error messages, it's not good to hard code the error messages into the card class itself.
And then how to display them to the user.
I could do it but I get the feeling that it's going to be a messy solution and I'm looking for the correct, best practice, symfony way.
Any ideas?
Or should I be using the form framework, I am already for accepting the user's card details, but how to display an error related to a web service call and not a problem with the information they've submitted.