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

chore: return proper http codes on unique constraint error #6428

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

vikrantgupta25
Copy link
Collaborator

@vikrantgupta25 vikrantgupta25 commented Nov 12, 2024

Summary

  • return proper http error codes for conflicting errors in licenses v3

Related Issues / PR's

Screenshots

image

Affected Areas and Manually Tested Areas

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@github-actions github-actions bot added the chore label Nov 12, 2024
@vikrantgupta25 vikrantgupta25 marked this pull request as ready for review November 12, 2024 13:13
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 7421ef3 in 51 seconds

More details
  • Looked at 73 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. ee/query-service/license/db.go:275
  • Draft comment:
    The function now returns *model.ApiError instead of error, which is consistent with the use of model.ApiError for API error handling. This change improves error handling by providing more structured error responses.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The error handling in the InsertLicenseV3 function has been updated to return model.ApiError instead of error. This change is consistent with the rest of the codebase where model.ApiError is used for API error handling. The change also includes specific handling for unique constraint violations, which is a good practice for providing more informative error responses.
2. ee/query-service/license/manager.go:466
  • Draft comment:
    The function now directly returns the error from InsertLicenseV3, which is a model.ApiError. This change ensures that the correct error type is propagated and is consistent with the updated error handling approach.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The error handling in the ActivateV3 function has been updated to directly return the error from InsertLicenseV3, which is now a model.ApiError. This change is consistent with the updated error handling approach and ensures that the correct error type is propagated.
3. pkg/query-service/app/http_handler.go:319
  • Draft comment:
    Avoid using inline styles. Use external stylesheets or styled components instead. This is also applicable in the liveTailLogs function.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_VTf6pOBlaDuGRpTV


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@vikrantgupta25
Copy link
Collaborator Author

@vikrantgupta25 vikrantgupta25 merged commit 01fda51 into develop Nov 12, 2024
16 checks passed
@vikrantgupta25 vikrantgupta25 deleted the return-conflict-error branch November 12, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants