Skip to content

added custom error handling utility#258

Open
TanmayTiwarii wants to merge 1 commit into
endee-io:masterfrom
TanmayTiwarii:master
Open

added custom error handling utility#258
TanmayTiwarii wants to merge 1 commit into
endee-io:masterfrom
TanmayTiwarii:master

Conversation

@TanmayTiwarii

@TanmayTiwarii TanmayTiwarii commented Jun 21, 2026

Copy link
Copy Markdown

Pull Request

Summary

This PR addresses an issue where the API endpoints returned 400 Bad Request for various operational failures (such as missing indexes or backup name conflicts).

It introduces a centralized exception class, ndd::ApiError, which encapsulates the appropriate HTTP status codes. The core backend logic (IndexManager and BackupStore) has been updated to throw these exceptions rather than returning boolean pairs or generic runtime errors. The router (main.cpp) now catches these custom exceptions and relays the precise HTTP status code back to the client.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor / cleanup

Related Issue

Closes #249

Checklist

  • Code compiles and tests pass
  • New tests added where applicable
  • Documentation updated if needed
  • No unintended breaking changes

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intuitive Error Handling

1 participant