4

Whenever Drupal encounters an unrecoverable error, it displays an error message.

Is there a way I can provide a template for this page?

3
  • 1
    Can you give an example of a Drupal error that you are talking about, or are you talking about a fatal PHP error?
    – mpdonadio
    Commented Jan 27, 2012 at 14:32
  • Are you missing gramatical php marks like a semi-colon, comma or quotations?
    – chrisjlee
    Commented Jan 27, 2012 at 17:37
  • 1
    He's talking about exceptions which are thrown and caught. This could be PDO exceptions (database error) or entity wrapper exceptions and a host of other exceptions which are caught and Drupal show an fatal error page.
    – googletorp
    Commented Jan 27, 2012 at 18:15

1 Answer 1

4

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

1
  • And for Drupal 8 this would be something like maintenance-page.twig ? Do you know? Commented Mar 7, 2019 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.