Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement consistent error handling for updatedBetween parameter across all endpoints #1558

Open
coderabbitai bot opened this issue Jan 21, 2025 · 0 comments

Comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2025

Current Behavior

When an invalid JSON is provided in the updatedBetween query parameter, the endpoints return a 500 Internal Server Error instead of a more appropriate 400 Bad Request.

Proposed Improvement

Add specific error handling for JSON parsing of updatedBetween parameter to return 400 Bad Request with a descriptive message when the input is malformed.

Implementation Details

  1. Add try-catch block around JSON.parse
  2. Return 400 Bad Request with descriptive message on parsing failure
  3. Apply the improvement consistently across all endpoints that accept updatedBetween parameter

References

/cc @MantisClone

@MantisClone MantisClone moved this from 🆕 New to 🎫 Backlog in Request Network Tech Backlog Jan 23, 2025
@MantisClone MantisClone moved this from 🎫 Backlog to 🆕 New in Request Network Tech Backlog Jan 24, 2025
@MantisClone MantisClone moved this from 🆕 New to 🎫 Backlog in Request Network Tech Backlog Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🎫 Backlog
Development

No branches or pull requests

0 participants