On Mon, 26 May 2025 20:39:51 GMT, Mark Sheppard <mshep...@openjdk.org> wrote:
> You could take a slightly more radical approach, and rather than applying a > filter explicitly on the exception message, adopt a builder pattern for the > creation of the filter exceptions, for example > > FilteredExceptionBuilder / EnhancedExceptionBuilder. > > It might provide be more flexible and provide, encapsulating the filtering > and policy application inside the builder. > > EnhancedExceptionBuilder::class() ::exceptionMessage() ::port() ::hostname() > ::userDetails() ::filterPolicy() We've been through so many iterations at this stage, that I think what we've landed on is reasonable and probably most importantly, concise such that it's not overly intrusive at the call sites. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23929#issuecomment-2918770154