Refactor: Improve logging and error handling in tests and components for better clarity and maintainability
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 25m9s

This commit is contained in:
2025-12-16 12:44:26 -08:00
parent 9be01a9dc2
commit 4277adac75
8 changed files with 168 additions and 92 deletions

View File

@@ -180,13 +180,16 @@ export const ProfileManager: React.FC<ProfileManagerProps> = ({ isOpen, onClose,
}
onClose();
} else {
logger.warn('[handleProfileSave] One or more operations failed. The useApi hook should have shown an error notification.');
logger.warn('[handleProfileSave] One or more operations failed. The useApi hook should have shown an error notification. The modal will remain open.');
}
} catch (error) {
// This catch block is a safeguard. In normal operation, the useApi hook
// should prevent any promises from rejecting.
logger.error({ err: error }, 'An unexpected error occurred in handleProfileSave:');
logger.error({ err: error }, '[CRITICAL] An unexpected error was caught directly in handleProfileSave\'s catch block.');
}
// This log confirms the function has completed its execution.
logger.debug('[handleProfileSave] Save process finished.');
};
const handleAddressChange = (field: keyof Address, value: string) => {