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
Is your feature request related to a problem? Please describe.
Summary
Today,
PolarisExceptionMapperis responsible for mapping everyPolarisExceptionsubtype to an HTTPResponse.Status. This creates coupling between the mapper and every exception type.Proposal
Invert this relationship by making
PolarisExceptiondefine a required method that returns its correspondingResponse.Status. Each exception subclass would provide its own status, allowingPolarisExceptionMapperto delegate to the exception instead of maintaining a centralized mapping.Benefits include:
PolarisExceptionMapperand exception implementations.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