Beamlet.Web.ErrorView (Beamlet v0.1.0)

Copy Markdown View Source

A plain error view for your endpoint.

config :my_app, MyAppWeb.Endpoint,
  render_errors: [
    formats: [html: Beamlet.Web.ErrorView, json: Beamlet.Web.ErrorView],
    layout: false
  ]

It renders the status message as text, or as {"errors": {"detail": ...}} for JSON. Your own error view works too.

Summary

Functions

Renders the response for an error template such as "404.html" or "500.json".

Functions

render(template, assigns)

@spec render(String.t(), map()) :: String.t() | map()

Renders the response for an error template such as "404.html" or "500.json".