handle conflict errors from run service (#2570)

* handle conflict errors from run service

* nit: formatting

* fix formatting
This commit is contained in:
Yashwanth Anantharaju
2023-04-27 13:59:12 -04:00
committed by GitHub
parent 58f3ff55aa
commit c8c47d4f27
5 changed files with 41 additions and 7 deletions

View File

@@ -86,6 +86,8 @@ namespace GitHub.Actions.RunService.WebApi
{
case HttpStatusCode.NotFound:
throw new TaskOrchestrationJobNotFoundException($"Job message not found: {messageId}");
case HttpStatusCode.Conflict:
throw new TaskOrchestrationJobAlreadyAcquiredException($"Job message already acquired: {messageId}");
default:
throw new Exception($"Failed to get job message: {result.Error}");
}