Fix error reporting when user is not authorized
What does this MR do and why?
This MR fixes the issue with error reporting when user isn't authorized logs (internal)
Screenshots or screen recordings
No visual changes.
How to set up and validate locally
I couldn't come up with a case to reproduce the issue locally but I believe that the added test gives a hint.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #238950 (closed)
Edited by Dzmitry (Dima) Meshcharakou