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
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 25m9s
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user