DuplicatedIdException Exception

Tags: v9preview5 v9

A DuplicatedIdException has been added to identify duplication of entity IDs.

It allows for a clear distinction between cases of identifier duplication and other errors. It applies to orders, guests, streets, dishes, payments, combos, modifiers, and components.

Example usage

try
{
    var order = operations.CreateOrder(...);
}
catch (DuplicatedIdException ex)
{
    // An order with this ID already exists
    PluginContext.Log.Warn($"Duplicate order ID detected: {ex.Message}");
}

See also