Canary.DefaultHandler (canary v2.0.0-dev)

The fallback Canary handler.

This module is used primarily as a backwards compatibility for the :not_found_handler and :unauthorized_handler. It uses old configuration values to determine how to handle the error.

If you are using Canary only with Plug based authorization then you can still use the :not_found_handler and :unauthorized_handler configuration values. Otherwise, you should implement the Canary.ErrorHandler behaviour in your own module.

Summary

Functions

The default handler for when a resource is not found. For Plug based authorization it will use the global :not_found_handler or return the conn.

The default handler for when a resource is not authorized. For Plug based authorization it will use the global :unauthorized_handler or return the conn.

Functions

not_found_handler(conn)

(since 2.0.0)

The default handler for when a resource is not found. For Plug based authorization it will use the global :not_found_handler or return the conn.

For LiveView base authorization it will halt socket.

unauthorized_handler(conn)

(since 2.0.0)

The default handler for when a resource is not authorized. For Plug based authorization it will use the global :unauthorized_handler or return the conn.

For LiveView base authorization it will halt socket.