mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-25 17:28:05 +00:00
b5d9b82bdd
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
19 lines
495 B
Elixir
19 lines
495 B
Elixir
defmodule Mobilizon.Service.ErrorPage do
|
|
@moduledoc """
|
|
Render an error page
|
|
"""
|
|
|
|
@spec init :: :ok | {:error, File.posix()}
|
|
def init do
|
|
render_error_page()
|
|
end
|
|
|
|
@spec render_error_page :: :ok | {:error, File.posix()}
|
|
defp render_error_page do
|
|
content =
|
|
Phoenix.View.render_to_string(Mobilizon.Web.ErrorView, "500.html", conn: %Plug.Conn{})
|
|
|
|
path = Path.join(Application.app_dir(:mobilizon, "priv/errors"), "error.html")
|
|
File.write(path, content)
|
|
end
|
|
end
|