Skip to content

Commit dc15657

Browse files
Merge pull request #1113 from solidify/bugfix/VS402624-error-handling
VS402624 error handling
2 parents 13bd396 + 5c9d0d3 commit dc15657

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/WorkItemMigrator/WorkItemImport/WitClient/WitClientWrapper.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public WorkItem UpdateWorkItem(JsonPatchDocument patchDocument, int workItemId,
121121
}
122122
catch (AggregateException ex)
123123
{
124-
bool datesMustIncreaseError = false;
124+
bool errorHandled = false;
125125
foreach (Exception ex2 in ex.InnerExceptions)
126126
{
127127
// Handle 'VS402625' error responses, the supplied ChangedDate was older than the latest revision already in ADO.
@@ -139,10 +139,18 @@ public WorkItem UpdateWorkItem(JsonPatchDocument patchDocument, int workItemId,
139139
break;
140140
}
141141
}
142-
datesMustIncreaseError = true;
142+
errorHandled = true;
143+
}
144+
// Handle 'VS402624' error responses, the supplied ChangedDate was in the future.
145+
// We must wait a while and try again.
146+
else if (ex2.Message.Contains("VS402624"))
147+
{
148+
Logger.Log(LogLevel.Warning, $"Received response while updating Work Item: {ex2.Message}." +
149+
$" Waiting and trying again...");
150+
errorHandled = true;
143151
}
144152
}
145-
if (!datesMustIncreaseError)
153+
if (!errorHandled)
146154
{
147155
throw;
148156
}

0 commit comments

Comments
 (0)