Alter page content using custom module
You can use the Drupal message system. 

Ex: drupal_set_message(t('Error message goes in here'), 'error');

In you case: drupal_set_message(t($yourvariable), 'error');