kommradHomer
Feb 21, 2024

--

Great explanation , thanks a lot.

We faced this "pitfall" when we needed to customize the error messages for users , when an error is thrown with switchIfEmpty(Mono.error(...)) and it proved impossible to get the current user via ReactiveSecurityContextHolder.

Finally solved it by passing the main context to the new stream via Mono.deferContextual( switchIfEmpty((Mono.error(...context here...)))) and carrying it on a field in our Custom Exception

--

--

kommradHomer
kommradHomer

Written by kommradHomer

proud seeder of 146.5GB The.Lord.of.the.Rings.Trilogy.1080p.Extended.Complete.Bluray.DTS-HD-6.1.x264-Grym

No responses yet