Display Error message

I think this example would help you.