Skip to content

Error handling in GRIP-api #5

@VijayrajS

Description

@VijayrajS

Currently the API does not return specific error codes (it is either a 200 or a 500 internal server error).

The following cases should be handled for the API endpoints:

  • When the format of the event id is wrong (400) (Reference for format of event IDs are in grip-core (grip/events/pfxevent.py, grip/events/details_<event_type>.py)
  • When the format is fine, but the event does not exist (404)
  • '/pfx_event/id//': Note: Check if event ID is available and if the prefix is available and valid too (all permutations) - prefix validity (400) and whether it does not belong to this event (404) (You can use ip address library to check validity of prefix)
  • When the elasticsearch instance is down (should be 500 or 503 - check this once, service unavailable)
  • Have a common function to check for event ID validity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions