-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-5094: Added try-catch block for UnauthorizedException #136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think throwing GraphQL\Error\UserError
might be more informative than no data returned. POV ping @bdunogier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think throwing
GraphQL\Error\UserError
might be more informative than no data returned. POV ping @bdunogier.
return null, will allow you to display the sub-items list but without the section and without the error that is currently going to the logs
Looks like this is a "dangling" class tied to GraphQL only by DI, which makes it difficult to understand what exactly calls it and what is the data flow.
@mateuszdebinski the issue only mentions logs. Does this mean that the output is correct and the issue occurs only in logs?
If we throw GraphQL\Error\UserError
instead of our exception, how does that change the output and logs? There's very little information to go on, so it's hard to review this one without spending some time on reverse-engineering.
My idea was to inform ( |
@alongosz Yes, this issue did not cause any other issues, apart from the entry in the logs, still, the user could see sub-items. If the user does not have access to the selected section, should we put information into the logs if it does not stop the operation and allows you to still display the information? |
IMHO it's a good idea to show it in logs and GraphiQL client because that might not be expected result, but permission "misconfiguration". The question is how does |
@alongosz I tested it, and, UserError doesn't throw any error into the log but in graphQL, you get something like this: where |
It seems that it provides value because someone might expect a section, but not get it and wonder why. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem no longer occurs.
QA Approved on Ibexa Commerce 3.3.34-dev
(diff ok on gql v2.3.16)
Jira: https://issues.ibexa.co/browse/IBX-5094