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

fix: Handle null SemanticModelStatus with 400 Bad Request in save and update APIs #290

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mittalVaghela
Copy link

@mittalVaghela mittalVaghela commented Aug 14, 2024

Description

This PR for save and update api to properly handle cases where the SemanticModelStatus parameter is null. Instead of resulting in an internal server error (HTTP 500), the application now returns a 400 Bad Request with a descriptive error message.

Fix

  • Error Handling: Updated the logic to check for null values in the SemanticModelStatus parameter for both save and
    updateModel methods.
  • Response Update: Modified the API response to return a 400 Bad Request status when SemanticModelStatus is null, instead of a 500 Internal Server Error.
  • Error Message: Provided a clear and informative error message: "SemanticModelStatus cannot be null. Valid values are: DRAFT, RELEASED, STANDARDIZED, DEPRECATED."

Issue:

Fixes #289

Pre-review checks

Please ensure to do as many of the following checks as possible, before asking for committer review:

Copy link

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.

POST & PUT API - Incorrect Status Parameter Handling
1 participant