Checking for the error message is called Red Box Testing.
Checking for the warning message is called Yellow Box Testing.