You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "flyrain (via GitHub)" <gi...@apache.org> on 2026/07/27 16:36:10 UTC
[I] Refactor PolarisException status mapping into PolarisException hierarchy [polaris]
flyrain opened a new issue, #5167:
URL: https://github.com/apache/polaris/issues/5167
### Is your feature request related to a problem? Please describe.
## Summary
Today, `PolarisExceptionMapper` is responsible for mapping every `PolarisException` subtype to an HTTP `Response.Status`. This creates coupling between the mapper and every exception type.
## Proposal
Invert this relationship by making `PolarisException` define a required method that returns its corresponding `Response.Status`. Each exception subclass would provide its own status, allowing `PolarisExceptionMapper` to delegate to the exception instead of maintaining a centralized mapping.
Benefits include:
* Reduces coupling between `PolarisExceptionMapper` and exception implementations.
* Makes it easier to add new exception types without modifying the mapper.
* Keeps the HTTP status semantics alongside the exception definition.
This is a follow up to the discussion in PR #4961.
### Describe the solution you'd like
_No response_
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
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: issues-unsubscribe@polaris.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Refactor PolarisException status mapping into PolarisException hierarchy [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain closed issue #5167: Refactor PolarisException status mapping into PolarisException hierarchy
URL: https://github.com/apache/polaris/issues/5167
--
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: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Refactor PolarisException status mapping into PolarisException hierarchy [polaris]
Posted by "harshitaajoshi (via GitHub)" <gi...@apache.org>.
harshitaajoshi commented on issue #5167:
URL: https://github.com/apache/polaris/issues/5167#issuecomment-5140157415
Hi, I would like to work on this. My plan is to add a default `httpStatusCode()` method on `PolarisException` returning 500, then override it in each subclass with the correct status code. This keeps `jakarta.ws` out of `polaris-core` by using plain `int`. The mapper would then delegate to `exception.httpStatusCode()` instead of maintaining the switch statement. I will include a parameterized test covering all subclasses. Happy to adjust based on feedback :)
--
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: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org