I have had this happen before. The problem was the brake light switch on the pedal.
To be sure this is the problem. First reset your alert by turning the car off and then turn the key to the on position. When the ESP alert shows on the dash, hold the R (reset button) in until the alert is cleared.
Then start the car, put the car in drive and move forward a few feet then hit the brake. If the alert apears again, it's your brake light switch. Another way to tell is have someone standing behind the car when you press the brake pedal. If the brake lights don't come on, you more than likely have a bad brake light switch.
I reset the fault on my car and it didn't come back for quite some time. It came back a few months later when I hit the brake at a stop light. My switch was working most of the time, but was going bad. You may not get results right away.
The other thing that happens is the brake pressure sensor can go bad and give you that same fault. 9 times out of 10 it's usually the brake light switch