Canary.ErrorHandler behaviour (canary v2.0.0-dev)

Specifies the behavior for handling errors in Canary.

Summary

Callbacks

Handles the case where a resource is not found.

Handles the case where a resource is not authorized.

Callbacks

not_found_handler(t)

(since 2.0.0)
@callback not_found_handler(Plug.Conn.t()) :: Plug.Conn.t()
@callback not_found_handler(Phoenix.LiveView.Socket.t()) ::
  {:halt, Phoenix.LiveView.Socket.t()}

Handles the case where a resource is not found.

unauthorized_handler(t)

(since 2.0.0)
@callback unauthorized_handler(Plug.Conn.t()) :: Plug.Conn.t()
@callback unauthorized_handler(Phoenix.LiveView.Socket.t()) ::
  {:halt, Phoenix.LiveView.Socket.t()}

Handles the case where a resource is not authorized.