If it is a new house
you usually get one-year warranty. If it is an old house, it is usually sold as is, unless the sales contract says otherwise. Either way, you are mostly out of luck. Your only other chance is to argue that the previous owner knew the condition and intentionally painted the over to cover it. It is not impossible, but comparing to the repair cose is it worth it?