Openmaize.Report

This module provides error and info messages and handles redirects if the option redirects is set to true.

If you are using Phoenix, then the error and info messages will be sent to phoenix_flash to be shown in the web browser.

Summary

Functions

Redirect the connection to the login page with an error message

Redirect the connection to the user’s role’s page with an error message

Redirect the connection to the home page with an info message

Redirect the connection to the user’s role’s page with an info message

Send a json-encoded error message as a response and then halt the connection. This function will be used if the redirects option is set to false

Return and halt the connection. Also, set the openmaize_skip value to true, which means that subsequent Openmaize plugs will just return the connection without performing any further checks

Functions

handle_error(conn, message)

Redirect the connection to the login page with an error message.

handle_error(conn, role, message)

Redirect the connection to the user’s role’s page with an error message.

handle_info(conn, message)

Redirect the connection to the home page with an info message.

handle_info(conn, role, message)

Redirect the connection to the user’s role’s page with an info message.

send_error(conn, status, message)

Send a json-encoded error message as a response and then halt the connection. This function will be used if the redirects option is set to false.

terminate(conn)

Return and halt the connection. Also, set the openmaize_skip value to true, which means that subsequent Openmaize plugs will just return the connection without performing any further checks.