Tarantula471 opened a new pull request, #10300:
URL: https://github.com/apache/gravitino/pull/10300
…P 500
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
Handle /configs servlet write failures with explicit HTTP 500 by setting
HttpServletResponse.SC_INTERNAL_SERVER_ERROR and returning JSON error body.
### Why are the changes needed?
It's an improvement for proper error handling because without setting a
status code, the response defaults to 200 (success), which misleads the client
into thinking the operation succeeded when it actually failed.
Fix: Set status as HttpServletResponse.SC_INTERNAL_SERVER_ERROR which
represents 500 Internal server error so that client can properly understand the
response outcome.
### Does this PR introduce _any_ user-facing change?
Whenever exception occurs in doGet() it will return proper error code the
client.
### How was this patch tested?
<img width="1408" height="614" alt="image"
src="https://github.com/user-attachments/assets/48ee843a-0531-4216-8aae-4842b168d07c"
/>
<img width="1472" height="624" alt="image"
src="https://github.com/user-attachments/assets/26fd1aca-ef6a-4a6b-b81d-c4a02fa7fe87"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]