LightningWeb.API.FallbackController (Lightning v2.20.1)

Copy Markdown View Source

Answers an API action's error result with a problem document. A controller that sets it as action_fallback returns refusals from its with and never picks a status itself. LightningWeb.Plugs.AuthorizeAction answers its refusals here too.

Each result has its own clause, and there is deliberately no catch-all. A result with no clause raises, so it shows up as a 500 and gets a clause. {:error, :unauthorized} from Permissions.can/4 has no clause either, because a refused permission is never a 401.

Summary

Functions

call(conn, arg)

@spec call(Plug.Conn.t(), term()) :: Plug.Conn.t()