lasdf1234 opened a new pull request, #14241:
URL: https://github.com/apache/gravitino/pull/14241

   <!--
   1. Title: [#<issue>] <type>(<scope>): <subject>
   -->
   
   ### What changes were proposed in this pull request?
   
   - Add `org.apache.gravitino.exceptions.ServiceUnavailableException`.
   - Add `ErrorConstants.SERVICE_UNAVAILABLE_CODE` (1013), 
`ErrorResponse.serviceUnavailable(...)`, and 
`Utils.serviceUnavailable(message[, throwable])` returning **HTTP 503**.
   - Map the exception in `ExceptionHandlers` (`BaseExceptionHandler`, catalog, 
and secret handlers).
   - Reconstruct `ServiceUnavailableException` in the Java client 
`ErrorHandlers` / `RestErrorHandler`.
   
   ### Why are the changes needed?
   
   `ConnectionFailedException` maps to HTTP 502, which fits federated catalog 
backends. Temporarily unavailable dependencies (for example a secret provider) 
should surface as **HTTP 503** so callers can tell retryable outages from 
gateway failures and from 500s.
   
   Fix: #14240
   
   ### Does this PR introduce any user-facing change?
   
   Yes:
   - New public exception type and REST error code.
   - APIs that throw `ServiceUnavailableException` return HTTP 503 with a 
structured `ErrorResponse`.
   
   ### How was this patch tested?
   
   ```
   ./gradlew :common:test --tests 
'org.apache.gravitino.dto.responses.TestResponses' \
     :server-common:test --tests 'org.apache.gravitino.server.web.TestUtils' \
     :server:test --tests 
'org.apache.gravitino.server.web.rest.TestExceptionHandlers' \
     :clients:client-java:test --tests 
'org.apache.gravitino.client.TestErrorHandlers'
   ```
   
   Made with [Cursor](https://cursor.com)


-- 
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]

Reply via email to