frontends icon indicating copy to clipboard operation
frontends copied to clipboard

feat(vue-starter-template): api error handler util

Open mdanilowicz opened this issue 2 months ago • 1 comments

This pull request refactors error handling across multiple account-related components by introducing a centralized apiErrorHandler utility. This change simplifies and standardizes how API errors are processed and displayed to users, replacing repetitive error handling code with a single function call. Additionally, unused imports and functions related to error handling are removed from affected files.

Error Handling Refactor

  • Added new apiErrorHandler utility in utils/validation/rules/errors/apiErrorHandler.ts to handle API errors in a consistent and reusable way across components.
  • Replaced custom error handling logic in form and account components (LoginForm.vue, RegistrationForm.vue, NewsletterBox.vue, index.vue, change-email.vue, change-password.vue, profile/index.vue) with calls to apiErrorHandler, streamlining error display and reducing code duplication. [1] [2] [3] [4] [5] [6] [7]

Cleanup of Imports and Unused Functions

  • Removed unused ApiClientError imports and resolveApiErrors function calls from components where error handling is now delegated to apiErrorHandler. [1] [2] [3] [4]

Minor Code Consistency

  • Adjusted the order of destructuring for pushSuccess and pushError from useNotifications for consistency in LoginForm.vue.

closes #2077

mdanilowicz avatar Oct 28 '25 07:10 mdanilowicz

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
frontends-demo Building Building Preview Nov 7, 2025 8:37am
frontends-vue-starter-template Building Building Preview Nov 7, 2025 8:37am
1 Skipped Deployment
Project Deployment Preview Updated (UTC)
shopware-frontends-docs Skipped Skipped Nov 7, 2025 8:37am

vercel[bot] avatar Oct 28 '25 07:10 vercel[bot]