Theming Drupal fatal error messages Whenever Drupal encounters an unrecoverable error, it displays an error message. 

Is there a way I can provide a template for this page?
The closest thing you come by is the maintenance-page.tpl.php, It doesn't cover all cases, but if things go wrong but not that wrong that Drupal can't post a page, it uses maintenance-page.tpl.php to display the error(s).

The error itself is displayed using drupal_set_message