RFR: 2411: Host::user should throw when failing

Erik Joelsson erikj at openjdk.org
Wed Nov 20 15:32:07 UTC 2024


On Wed, 20 Nov 2024 15:19:40 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

> One question about the Description:
> 
> > The implementations of Host::user are all currently returning Optional::empty on any error return code
> 
> I think you mean they are all currently returning `Optional.of(JSON.of())` right? And that after this change you will continue to return that for 404, and return `Optional.empty()` (which will throw) for all other cases.

No, the description is about the `Host::user` method, which in turn uses `RestRequest`, providing a lambda for `onError`. What you are describing is what that lambda does, which the `Host::user` methods will translate to `Optional<HostUser>` that either contains an instance of HostUser, or is empty.

-------------

PR Comment: https://git.openjdk.org/skara/pull/1698#issuecomment-2488894530


More information about the skara-dev mailing list