Skip to content

IAV-691/feat(customer-care): Integrate unified exception handling

salaheddine zidani a demandé de fusionner feature/IAV-691 vers develop

Summary

Integrates the unified exception handling from iavia-common into iavia-agent-service-customer-care, ensuring standardized error responses across all service layers.

Changes

Modified

  • GlobalExceptionHandler: Refactored to produce ApiErrorResponse with origin, code, details, and timestamp
  • BusinessErrorCode: Expanded to 100+ error codes organized by domain (Agent, Language, Instructions, Workflow, etc.)

Added

  • BusinessErrorCodeTest: Validation suite ensuring:
    • All codes are unique
    • All codes follow pattern ^[A-Z0-9]{4}-\d{3}$
    • All messages are unique, non-empty, and properly formatted

Integrated

Unified exception handling applied across all layers:

Layer Classes
External Services FileManagerServiceImpl, N8nServiceImpl, UserServiceImpl
Helpers AgentCreationHelper, AgentValidationHelper, UserHelper, WebhookHelper
Business Services AgentServiceImpl, AgentCustomInstructionServiceImpl, AgentStandardInstructionServiceImpl, AgentSystemPromptConfigServiceImpl, ConfigStandardInstructionServiceImpl, MainAgentWizardServiceImpl, SubAgentServiceImpl

Benefits

  • Consistent error format for frontend i18n mapping
  • Upstream errors propagated with original source identification
  • No sensitive technical details exposed to clients
  • Comprehensive test coverage for error code integrity

Dependencies

Requires iavia-common with unified exception handling components (see MR: https://mc-git.com/iavia/iavia-common/-/merge_requests/67)

Related Documentation

See the iavia unified exception handling guide (PDF) for implementation details.

Closes IAV-261

Rapports de requête de fusion