-
Notifications
You must be signed in to change notification settings - Fork 467
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
GraphQL: Improve Error Message for Unauthorized Page Request #29270
Labels
Comments
fmontes
added
OKR : Core Features
Owned by Will
Priority : 3 Average
Team : Scout
Type : Defect
labels
Jul 18, 2024
valentinogiardino
added a commit
that referenced
this issue
Aug 9, 2024
valentinogiardino
added a commit
that referenced
this issue
Aug 9, 2024
valentinogiardino
added a commit
that referenced
this issue
Aug 9, 2024
valentinogiardino
added a commit
that referenced
this issue
Aug 9, 2024
1 task
valentinogiardino
added a commit
that referenced
this issue
Aug 12, 2024
valentinogiardino
added a commit
that referenced
this issue
Aug 12, 2024
valentinogiardino
added a commit
that referenced
this issue
Aug 12, 2024
**Reason for Rollback**: - The change to use `GraphQLErrorException` as the base class for `PermissionDeniedGraphQLException` caused a violation of the SonarQube rule "Inheritance tree of classes should not be too deep." - The inheritance tree depth exceeded the allowed limit, leading to maintainability issues flagged by SonarQube.
github-merge-queue bot
pushed a commit
that referenced
this issue
Aug 12, 2024
…request (#29521) ### Proposed Changes Enhance the error handling capabilities of our GraphQL API by introducing a custom exception class that aligns with the GraphQL error handling guidelines. * Added a custom GraphQL exception class that implements `GraphQLError`. * Introduced `PermissionDeniedGraphQLException` for unauthorized access. * Fixed error message for unauthorized page requests. * Added Postman test for exception handling. ### Checklist - [x] Unauthorized query request should return a correct error message ### Screenshots #### Before: ![image](https://github.com/user-attachments/assets/8ee2cd67-af11-4616-abec-534dd2b56b88) #### After: ![image](https://github.com/user-attachments/assets/8dd74fb9-d0ee-4c80-8d99-6056ade8eac5) This PR fixes #29270
Passed Internal QA
Videoiqa-29270-graphql-improve-error-message-for-unauthorized-page-request-1.movTest CaseQuery:query {
page( url: "/index", pageMode: "WORKING") {
title
}
} Response{
"errors": [
{
"message": "Exception while fetching data (/page) : Unauthorized: You do not have the necessary permissions to request this page in edit mode.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"page"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": {
"page": null
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Problem Statement
When making a GraphQL request for a working page (edit mode) without authentication, dotCMS returns a 500 error without providing any useful error message.
Steps to Reproduce
gql-permission-error.mp4
Acceptance Criteria
An example error could be:
External Links
N/A
Assumptions & Initiation Needs
N/A
Quality Assurance Notes & Workarounds
Currently, there is no workaround for this issue. QA testing should focus on verifying that the error message is improved when making unauthorized GraphQL requests for working pages.
The text was updated successfully, but these errors were encountered: