Vex.ErrorRenderer behaviour (Vex v0.9.2) View Source

Implementation of this behaviour should be set in validator options as :error_renderer or in :vex application config with same key.

Common pattern is to expect :message key in validator options and if it not set use default_message (use get_message function for it).

Result of message function appears in Vex.errors error tuple as last element, for those validators who use Vex.Validator.ErrorMessage (in general they should).

Link to this section Summary

Link to this section Functions

Link to this function

get_message(options, default)

View Source

Link to this section Callbacks

Link to this callback

message(validator_options, default_message, context)

View Source

Specs

message(
  validator_options :: list(),
  default_message :: String.t(),
  context :: list()
) :: any()