Display better error message on the UI when compliance framework creation fails
Description
When compliance framework creation fails, the user gets the following error message "Unable to save this compliance framework. Please try again", however, this message isn't much useful as even retrying doesn't help.
Steps to reproduce
- Create a compliance framework named "ABC"
- Verify that the framework is created successfully
- Go back and create another framework with the same name "ABC"
- This time the creation would fail and you'll see an error message as mentioned above.
Proposal
From the backend we're sending the error reason in GraphQL response, like this
{
"data": {
"createComplianceFramework": {
"framework": null,
"errors": [
"Failed to create framework",
"Namespace has already been taken"
],
"__typename": "CreateComplianceFrameworkPayload"
}
}
}
We can think of propagating the same error on the UI with better message. We can also fix the message on the backend here and use the exact same message and display it on the UI at the frontend.
Edited by 🤖 GitLab Bot 🤖
