travis-bowen commented on code in PR #4404:
URL: https://github.com/apache/polaris/pull/4404#discussion_r3236191476
##########
runtime/service/src/main/java/org/apache/polaris/service/ratelimiter/RateLimiterFilter.java:
##########
@@ -74,7 +76,16 @@ public void filter(ContainerRequestContext ctx) throws
IOException {
EventAttributes.REQUEST_URI,
ctx.getUriInfo().getAbsolutePath().toString())));
}
-
ctx.abortWith(Response.status(Response.Status.TOO_MANY_REQUESTS).build());
+ ctx.abortWith(
+ Response.status(Response.Status.TOO_MANY_REQUESTS)
+ .type(MediaType.APPLICATION_JSON_TYPE)
+ .entity(
+ ErrorResponse.builder()
+
.responseCode(Response.Status.TOO_MANY_REQUESTS.getStatusCode())
+ .withType("RateLimitExceededException")
Review Comment:
Appreciate the thorough review!
I pulled the error message from the exception message I had ran into based
on the implementation.
It's not as aligned to Iceberg as would be ideal.
I'll change it to `TooManyRequestsException`
Iceberg itself doesn't have this exception, but pyIceberg does and so it
seems fitting and roughly aligned to what Iceberg exception might call it.
https://github.com/apache/iceberg/tree/apache-iceberg-1.10.1/api/src/main/java/org/apache/iceberg/exceptions
https://github.com/apache/iceberg-python/blob/a9ad3a305fb91abd7edecc029ccc4178398056fe/pyiceberg/exceptions.py#L91
Open to other names though
--
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]