Skip to content

Commit

Permalink
Cleanup back-compat code for interpreting Run Service status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsciple committed Sep 6, 2024
1 parent 4c0a43f commit 010753b
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/Sdk/RSWebApi/RunServiceHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ public async Task<AgentJobRequestMessage> GetJobMessageAsync(
}
}

// Temporary back compat
switch (result.StatusCode)
{
case HttpStatusCode.NotFound:
throw new TaskOrchestrationJobNotFoundException($"Job message not found: {messageId}");
case HttpStatusCode.Conflict:
throw new TaskOrchestrationJobAlreadyAcquiredException($"Job message already acquired: {messageId}");
}

if (!string.IsNullOrEmpty(result.ErrorBody))
{
throw new Exception($"Failed to get job message: {result.Error}. {Truncate(result.ErrorBody)}");
Expand Down Expand Up @@ -171,13 +162,6 @@ public async Task CompleteJobAsync(
}
}

// Temporary back compat
switch (result.StatusCode)
{
case HttpStatusCode.NotFound:
throw new TaskOrchestrationJobNotFoundException($"Job not found: {jobId}");
}

if (!string.IsNullOrEmpty(result.ErrorBody))
{
throw new Exception($"Failed to complete job: {result.Error}. {Truncate(result.ErrorBody)}");
Expand Down Expand Up @@ -225,13 +209,6 @@ public async Task<RenewJobResponse> RenewJobAsync(
}
}

// Temporary back compat
switch (result.StatusCode)
{
case HttpStatusCode.NotFound:
throw new TaskOrchestrationJobNotFoundException($"Job not found: {jobId}");
}

if (!string.IsNullOrEmpty(result.ErrorBody))
{
throw new Exception($"Failed to renew job: {result.Error}. {Truncate(result.ErrorBody)}");
Expand Down

0 comments on commit 010753b

Please sign in to comment.