One skills that has helped me a lot in my career is the ability to apologize. Whenever someone brings a problem to my attention, I use this 5-part apology formula.
1) Thank the person for bringing the issue to your attention.
2) Apologize for the mistake.
3) Let them know briefly how it happened.
4) Tell them what you are doing differently to make sure it does not happen again. This is a good time to state your commitment to quality or excellence if it is an error that is hard to prevent or if you are not sure how to phrase what you are going to do to prevent it from happening again. Depending on the degree of the error, you may want to offer them something at this point such as free shipping on their next order of merchandise.
5) Thank them again for calling this issue to your attention.
Here is an excellent example of an apology letter.