Skip to main content

Errors

Error Handling in Hii Retail

Hii Retail uses an Event-Driven and Reactive architecture. Data is eventually consistent, and services react to events from other systems.

This architecture allows each service to report its own issues.

Example:
If "Faulty data" (e.g., a non-existent Business Unit ID) is sent to the Item input API, the API returns 202 - Accepted. The data is stored and distributed, but downstream services (like Store Data) may not find the Business Unit. They can alert the External Events system:
"Data for Business Unit 545534 received. This Business Unit is not present. Please check your data!"

The benefit: data is available to other systems while missing references are resolved. When the missing entity is added, processing continues as expected.

Error Types

There are two main error types:

Synchronous Errors

These occur immediately when sending data to Hii Retail (e.g., missing content, invalid token, missing roles, or invalid data). See each API for possible response codes.

Asynchronous Errors

Unexpected errors in the data flow are handled in Dead Letter Queues, where problematic data is stored for later processing. Integration errors are reported asynchronously via the External Event service.

Loose coupling and eventual consistency allow systems to remain operational even if one service encounters a problem.

Recommendation: Subscribe to Customer Notifications in the External Event service for alerts.