Alter page content using custom module I'm writing a custom module which will process information using an external service and need to display any errors thrown by this service.

I already have a variable containing error messages.

How can I target a page body markup to show the error message? I have tried hook_page_alter but failed not knowing if a page body can be processed at this stage.

Thanks
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');