Avoid Sentry capture for expected attribute validation errors

What does this MR do and why?

Stops expected security-attribute validation errors from being reported to Sentry as exceptions.

In ee/app/assets/javascripts/security_configuration/components/security_attributes/configure_attributes.vue, payload-level errors from the securityAttributeCreate, securityAttributeUpdate, and securityCategoryCreate GraphQL mutations were thrown into a shared catch block that calls Sentry.captureException. That meant routine user validation failures — a duplicate name, or hitting the per-category attribute limit or per-namespace category limit — showed up in Sentry as exceptions even though nothing was broken, adding noise that obscures real errors.

This MR handles those payload errors inline: it calls createAlert with the error message and returns early instead of throwing. The catch block, and its Sentry.captureException call, is now reserved for genuine unexpected failures such as network errors and real bugs. The alert message shown to the user is unchanged.

References

Resolves #607555

Originated from a review comment on !245601 (merged)

Screenshots or screen recordings

No screenshots needed — there is no visible UI change. The alert message and behavior are identical from the user's perspective; only the internal Sentry reporting changes.

How to set up and validate locally

  1. As a group owner, go to a group's Security attributes settings page.
  2. Create a security category, then create an attribute under it.
  3. Trigger a validation error, for example:
    • Create a second attribute using a name that already exists, or
    • Exceed the per-category attribute limit or per-namespace category limit.
  4. Confirm the inline alert still shows the expected validation message.
  5. Confirm no Sentry event is generated for that expected error.
  6. As a contrast check, simulate a genuine network failure (e.g. block the GraphQL request in devtools) and confirm Sentry.captureException is still called in that case.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Merge request reports

Loading
Loading