Refactoring to graphql error message handling
MR: Pending ## Description The following discussion from !135413 should be addressed: - [ ] @cwoolley-gitlab started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/135413#note_1678814403): > Now that this is duplicated 3 times, lets pull it out to a separate module to dry it up: > > But let's do this in a separate MR, and do a bigger refactor cleanup. See related thread here: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136653#note_1678862436 > > 1. Pull `#raise_resource_not_available_error!` out of `Gitlab::Graphql::Authorize::AuthorizeResource` so it can be used independently even for classes that have no need to work with a related `object` or `resource` (e.g. root query resolvers like the one in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136653#note_1678862436 > 2. New module can be something like `Gitlab::Graphql::Authorize::ErrorMessageHandling` > 3. To the new module, add a new helper method like `ensure_licensed_feature_available!(feature)` which has the behavior of these lines. I.e., check for the license, and return a friendly and useful error message if it doesn't. ## Acceptance Criteria - [ ] Duplication is removed as described in the description of this issue ## Technical Requirements - See description for details <!-- Replace with other type, e.g. bug or maintenance, if appropriate --> <!-- Replace with other subtype if appropriate --> <!-- By default, all issues start in the unprioritized status. See https://about.gitlab.com/handbook/engineering/development/dev/create/ide/#-remote-development-planning-process --> <!-- For simplicity and to avoid triage bot warnings about missing workflow labels, we will default to issues starting at the refinement phase -->
issue