feat: integrate error handling across various components

- Added `useErrorHandler` hook to centralize error handling logic.
- Updated components in the backoffice and portal applications to utilize the new error handling mechanism, replacing direct notify calls with `handleError` for improved error messaging.
- Enhanced localization files to include generic error messages for better user feedback.
- Refactored error handling in forms and API interactions to ensure consistent user experience across the application.
This commit is contained in:
estifanos
2026-07-24 09:08:41 +00:00
parent 4ccf27c044
commit 8f7c163b9e
28 changed files with 229 additions and 121 deletions

View File

@@ -8,6 +8,17 @@ export const am: Translations = {
tagline: 'የቁጥጥር ማዕከል',
},
msg: {
genericError: 'የሆነ ስህተት ተፈጥሯል። እባክዎ እንደገና ይሞክሩ።',
serverError: 'የሰርቨር ስህተት። እባክዎ ቆየት ብለው እንደገና ይሞክሩ።',
validationError: 'እባክዎ ያስገቡትን መረጃ ያረጋግጡና እንደገና ይሞክሩ።',
authError: 'ክፍለ ጊዜዎ አልቋል። እባክዎ እንደገና ይግቡ።',
permissionError: 'ይህን ድርጊት ለመፈጸም ፈቃድ የለዎትም።',
notFoundError: 'የተጠየቀው ንጥል አልተገኘም።',
fileTooLarge: 'ፋይሉ ለመስቀል በጣም ትልቅ ነው።',
networkError: 'የአውታረ መረብ ስህተት። ግንኙነትዎን አረጋግጠው እንደገና ይሞክሩ።',
},
language: {
label: 'ቋንቋ',
en: 'English',

View File

@@ -6,6 +6,17 @@ export const en = {
tagline: 'Control Center',
},
msg: {
genericError: 'Something went wrong. Please try again.',
serverError: 'Server error. Please try again later.',
validationError: 'Please check your input and try again.',
authError: 'Your session has expired. Please sign in again.',
permissionError: "You don't have permission to perform this action.",
notFoundError: 'The requested item was not found.',
fileTooLarge: 'The file is too large to upload.',
networkError: 'Network error. Check your connection and try again.',
},
language: {
label: 'Language',
en: 'English',