Skip to main content
3 of 3
Explain more clearly that the output contains HTML
AdamS
  • 817
  • 7
  • 17

Display "uncaught exception" page as content-type text/html

When there is an uncaught exception, Drupal 8 displays a simple dump of the exception.

I find that the page is served as 'Content-Type' = 'text/plain', yet it contains HTML: Error as plain text

It looks better to me when I change the code to serve as 'text/html': Error as HTML

I already found the code to change - it's in FinalExceptionSubscriber.php, which outputs

Formats a string for HTML display by replacing variable placeholders.

My question is:

  1. Does anyone know a reason why the error page is text/plain given that it contains HTML.
  2. Shall I raise an issue and patch?
AdamS
  • 817
  • 7
  • 17