SaltDnsWeb.API.FallbackController (Salt v1.0.0)

Turns the {:error, reason} an API action returns into a problem response.

  • :forbidden - 403 (SaltDns.Access said no)
  • :not_found - 404
  • :conflict - 409
  • :zone_frozen - 503, zone_frozen: DNSSEC keys missing on the leader's node
  • :precondition_failed - 412 (If-Match / If-None-Match)
  • {:invalid, errors} - 422 with the field errors; {:invalid, errors, prefix} puts prefix (for example ["operations"]) in front of every path. A single not_found error is a 404.
  • {:transfer_failed, reason} - 502, the primary could not be transferred from
  • {:changeset, changeset} - 422 from an Ecto changeset

Summary

Functions

Flattens a changeset's errors into SaltDns.Zones.Error values.

Functions

changeset_errors(changeset)

@spec changeset_errors(Ecto.Changeset.t()) :: [SaltDns.Zones.Error.t()]

Flattens a changeset's errors into SaltDns.Zones.Error values.