Skip to content
This repository was archived by the owner on Oct 6, 2026. It is now read-only.
This repository was archived by the owner on Oct 6, 2026. It is now read-only.

Intuitive Error Handling #249

Description

@pankajEndee

Description

Status codes for errors in many apis is giving 400 (Bad Request). Here are the important ones:

  • Backup Name conflict in the create backup api gives 400. (Should give 409)
  • Restored index name conflict in the restore backup api gives 400. (Should give 409)
  • Backup not found in the restore backup api gives 400. (Should give 404)
  • Backup not found in the delete backup api gives 400. (Should give 404)
  • Index not found in the vector operation (insert, get vector, update filter) api gives 400. (Should give 404)

Steps to Reproduce

  1. Hit APIs with conflicted names or backups/index that does not exist.

Cause

A lot of these checks are inside main.cpp and many others in the ndd.hpp. The error which are coming from ndd.hpp do not return a code. It just returns a pair with {success: bool, message: string}. Failure on these, just sends a 400 status code

Fixes and Discussion

  • Should make a common exceptions and error handling util.
  • Should move all the checks/validations to either main.cpp or ndd.hpp.
  • If all the validations move to ndd.hpp, they should return the status codes too.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions