{% extends 'Layouts/Doc/default.html.twig' %} {% block title %}Documentation {% endblock %} {% block headerPageTitle %} {{ 'app.documentation.page.title.error'|trans |upper}} {% endblock %} {% macro renderTree(node, level) %} {% set badgeClass = { 0: 'light-primary', 1: 'light-info', 2: 'light-warning', 3: 'light-success', 4: 'secondary', }[level]|default('secondary') %}
  • {{ node.name|badge(badgeClass) }} {% if node.messages is not empty %} {% endif %} {% if node.children is not empty %} {% endif %}
  • {% endmacro %} {% block body %}

    API errors responses

    Foxorder's API includes an error management system, this system allows users to have assistance in case of error.

    Depending on the type of errors, the error message is often explicit (typing, null, format, etc.) otherwise, it indicates the source of the error and possibly the solution.

    Logo
    {% for group in apis %} {% if section is null %} {% endif %} {% set authorized = 'app.documentation.badge.authorized'|trans|badge('light-success', false) %} {% set unauthorized = 'app.documentation.badge.unauthorized'|trans|badge('light-danger', false) %} {% for value in group.list %} {% if value.errors is defined %} {% endif %} {% else %} {% endfor %} {% else %} {% endfor %}
    Endpoint Method Error code => message
    {{ group.group|upper }}
    {{ value.api }} {% set typeClass = { 'POST': 'warning', 'PUT': 'primary', 'PATCH': 'info', 'DELETE': 'danger' }[value.type]|default('success') %} {{ value.type|upper|badge('light-' ~ typeClass, false) }}
      {% for err in value.errors %}
    • {{ err.code|badge('light-danger') }} => {{ err.message }} {% if err.violations is defined %}
        {% for nodePath, node in err.violations %} {{ _self.renderTree(node, 0) }} {% endfor %}
      {% endif %}
    • {% endfor %}
    {{ 'app.global.detail.no_record_found'|trans }}
    {{ 'app.global.detail.no_record_found'|trans }}
    {% endblock %}