diff --git a/priv/templates/common/phx.gen.html/controller.ex b/priv/templates/common/phx.gen.html/controller.ex
index 3f024924..be206eff 100644
--- a/priv/templates/common/phx.gen.html/controller.ex
+++ b/priv/templates/common/phx.gen.html/controller.ex
@@ -11,7 +11,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
case <%= inspect context.alias %>.paginate_<%= schema.plural %>(params) do
{:ok, assigns} ->
render(conn, "index.html", assigns)
- error ->
+ {:error, error} ->
conn
|> put_flash(:error, "There was an error rendering <%= schema.human_plural %>. #{inspect(error)}")
|> redirect(to: Routes.<%= schema.route_helper %>_path(conn, :index))