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:
- 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
errorparameter here would always be a new, uniqueErrorobject returned from the Vuex state, even if it was technically for the same kind of error from a user's point of view. -
showAlertwas being passed the error object itself, when its inner methodcreateAlertactually 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 |
|---|---|
![]() |
![]() |
How to set up and validate locally
- In
Licenses::DestroyService, simulate raising an error when deleting a license, such as removing theunless licenseconditional here and allowingActiveRecord::RecordNotFoundto always be raised - Log into your GDK as an admin
- Upload a license or activate a cloud license on your GDK instance
- Visit the
/admin/subscriptionpage and click theRemove licensebutton - 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)

