StorageBackedSessionManager Contract
Cantor, Scott
cantor.2 at osu.edu
Tue Sep 20 08:45:11 EDT 2016
> > I would have expected it to simply return null in this case due to the
> > resolveSingle method bearning a @Nullable annotation on the return type.
> > Obviously I can trap this case as well, but it doesn't seem right to me.
>
> It's layering, that's all happening far below the session cache. Using the client
> storage service absolutely requires that the data get loaded explicitly first. It
> can't distinguish between the data not being loaded and an empty store if it
> just auto-initialized the store, so it has a constraint baked in to make sure
> that the system outright breaks if the flow isn't using the service correctly.
By extension, no, it's absolutely incorrect to trap it. I would never raise an unchecked exception that was meant to be caught, it's a signal there's a bug in the code.
-- Scott
More information about the dev
mailing list