Fix Error Handling Logic in Subscription Breakdown Vue Component

What does this MR do and why?

Resolves #557617 (closed)

Previously, the watch on the licenseError in subscription_breakdown.vue had a few issues:

  1. The logic to early return if an error did not exist, or was equal to the previous error, was unreachable code. This is because the error parameter here would always be a new, unique Error object returned from the Vuex state, even if it was technically for the same kind of error from a user's point of view.
  2. showAlert was being passed the error object itself, when its inner method createAlert actually expects a string. This would cause an empty alert to display.

This MR replaces this logic with a few improvements. In the event of a license removal error, the error's details will be logged to the console via the logError helper, while a user-friendly error message will display to the user. This change improves the user experience by providing a clearer error message while also enhancing debugging capabilities through proper error logging, ensuring both users and developers have better visibility into license removal issues.

References

Screenshots or screen recordings

Before After
Screenshot_2025-08-13_at_12.53.32_PM Screenshot_2025-08-13_at_12.50.37_PM

How to set up and validate locally

  1. In Licenses::DestroyService, simulate raising an error when deleting a license, such as removing the unless license conditional here and allowing ActiveRecord::RecordNotFound to always be raised
  2. Log into your GDK as an admin
  3. Upload a license or activate a cloud license on your GDK instance
  4. Visit the /admin/subscription page and click the Remove license button
  5. Verify that an error alert with the message Something went wrong while removing the license. Please try again. is displayed at the top of the page

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #557617 (closed)

Edited by Valerie Burton

Merge request reports

Loading