Use OrchestrationAlreadyExistsException instead of InvalidOperationException (#375)

This commit is contained in:
Chris Gillum 2024-04-05 14:46:11 -07:00 коммит произвёл GitHub
Родитель 3399888400
Коммит 5a2fdc3e38
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -13,6 +13,7 @@ namespace DurableTask.Netherite
using System.Threading.Tasks;
using Azure.Core;
using DurableTask.Core;
using DurableTask.Core.Exceptions;
using DurableTask.Core.History;
using Microsoft.Azure.Storage;
using Newtonsoft.Json;
@ -473,7 +474,7 @@ namespace DurableTask.Netherite
// An instance in this state already exists.
if (this.host.Settings.ThrowExceptionOnInvalidDedupeStatus)
{
throw new InvalidOperationException($"An Orchestration instance with the status {creationResponseReceived.ExistingInstanceOrchestrationStatus} already exists.");
throw new OrchestrationAlreadyExistsException($"An Orchestration instance with the status {creationResponseReceived.ExistingInstanceOrchestrationStatus} already exists.");
}
}
}