Pretty error pages not rendering in dev after Phoenix upgrade

I’ve just upgraded my version of Phoenix (and the Sentry client) which resulted in the following changes:

-  "certifi": {:hex, :certifi, "2.6.1", ...
+  "certifi": {:hex, :certifi, "2.8.0", ...

-  "hackney": {:hex, :hackney, "1.17.4", ...
+  "hackney": {:hex, :hackney, "1.18.0", ...

-  "phoenix": {:hex, :phoenix, "1.5.9", ...
+  "phoenix": {:hex, :phoenix, "1.5.13", ...

-  "plug": {:hex, :plug, "1.11.1", ...
+  "plug": {:hex, :plug, "1.12.1", ...

-  "plug_cowboy": {:hex, :plug_cowboy, "2.5.0", ...
+  "plug_cowboy": {:hex, :plug_cowboy, "2.5.2", ...

-  "poison": {:hex, :poison, "3.1.0", ...
+  "poison": {:hex, :poison, "4.0.1", ...

-  "sentry": {:hex, :sentry, "6.4.2", ...
+  "sentry": {:hex, :sentry, "8.0.0", ...

Everything seems to work OK, except when an exception is thrown in dev I no longer get the pretty exception page provided by phoenix. Instead I the response body is just Something went wrong:

HTTP/1.1 500 Internal Server Error

Something went wrong

Any idea why this has happened and how to resolve? I assume the pretty error page is still default behaviour for the dev environment.

What error message do you have in the elixir console?

Also did you follow the sentry upgrade guide since you’re updating a major version?

1 Like

What error message do you have in the elixir console?

I just manually raised an error in a controller handler. The error is correctly printed in the elixir console.

Also did you follow the sentry upgrade guide

I thought I had, but had neglected to remove Plug.ErrorHandler as described. It looks like removing it has allowed the pretty error printing to return.

1 Like