addErrorMessage of the GlideSystem class can be used to add an error message to the current interactive user session. These session error messages are shown to end users at the top of the form and above any addInfoMessage entries.
Usage:
gs.addErrorMessage(Object message);
Example:
gs.addErrorMessage("Incident record successfully updated.");