Phoenix.Router.RenderErrors

A module used to catch failures and render them using a view.

This module is automatically used in Phoenix.Router but it could be used with any other module that defines call/2 as an overridable function:

defmodule MyPlug do
  use Plug.Builder
  use Phoenix.Router.RenderErrors, view: MyApp.ErrorsView

  ...
end

The options available on use are defined in the documentation for the wrap/3 function.

Summary

wrap(conn, opts, fun)

Wraps a given function and renders a nice error page using the given view

Functions

wrap(conn, opts, fun)

Wraps a given function and renders a nice error page using the given view.

Options

  • :view - the name of the view we render templates against