Action Point Dashboard
  • Action Point Dashboard Documentation
  • INTRODUCTION
    • Glossary / Terminology
    • FAQ
    • Releases / Changelog*
    • Report an Issue / Contact us
  • PRODUCT / END-USER DOCUMENTATION
    • Overview
      • Objectives
      • User roles and permissions
    • Action Points Dashboard Navigation
    • Overall User Interface
    • List of Action Points
    • Action Points Workflow
    • Action Points
      • Creation of Action Point
      • Modification of Action Point
      • Completion of Action Point
      • Additional options for Action Point
    • Connections to other modules
      • Overview
      • Action Points in FAM
      • Action Points in Field Monitoring
      • Action Points in TPM
      • Action Points in Trip Management (T2F)
  • TECHNICAL DOCUMENTATION
    • Architecture
    • Development Setup
    • Deployment / DevOps
    • Data Model
    • Fixtures & management commands
    • API Documentation
      • Error Handling
    • Backend module structure
    • Integration with permissions framework
    • Frontend
      • Module structure
      • Build process
      • Tests
Powered by GitBook
On this page
  1. TECHNICAL DOCUMENTATION
  2. API Documentation

Error Handling

Original Django Rest Framework has been modified a bit for consistency and extended to include error codes.

Expected http status codes are 404 and 400. 400 rresponse details are presented below:

General / Non Field Errors

A response for a single error would look like the following:

{
    "non_field_errors": [
        "Error message"
    ],
    "error_codes": [
        "invalid"
    ]
}

Multiple errors can be provided under non_field_errors key, eg.:

{
    "non_field_errors": [
        "Error message",
        "Another error"
    ],
    "error_codes": [
        "invalid",
        "invalid"
    ]
}

Field Errors

Errors, assosiated with the fields, will be returned as a mapping

{
    "email": [
        "This field is required."
    ],
    "error_codes": {
        "email": [
            "required"
        ]
    }
}

And of course can contain multiple messages for a single field:

{
    "field1": [
        "Err1",
        "Err2"
    ],
    "field2": [
        "Err3"
    ],
    "error_codes": {
        "field1": [
            "invalid",
            "invalid"
        ],
        "field2": [
            "invalid"
        ]
    }
}

Any exceptions to these rules should be treated as bugs and reported.

PreviousAPI DocumentationNextBackend module structure

Last updated 6 years ago