Skip to content

Commit

Permalink
Updated DeniedOrNotExistException for better error message. +telemi…
Browse files Browse the repository at this point in the history
…try for the error.
  • Loading branch information
MrHinsh committed Feb 16, 2024
1 parent e9c3108 commit 43d217d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void TfsWorkItemEndPointGetWorkItemsTest()
var endpoint = Services.GetRequiredService<TfsWorkItemEndpoint>();
endpoint.Configure(GetTfsWorkItemEndPointOptions("migrationSource1"));
IEnumerable<WorkItemData> result = endpoint.GetWorkItems();
Assert.AreEqual(11, result.Count());
Assert.AreEqual(12, result.Count());
}

[TestMethod(), TestCategory("L3"), TestCategory("AzureDevOps.ObjectModel")]
Expand All @@ -56,7 +56,7 @@ public void TfsWorkItemEndPointGetWorkItemsQueryTest()
Parameters = new Dictionary<string, string>() { { "TeamProject", "migrationSource1" } }
};
IEnumerable<WorkItemData> result = endpoint.GetWorkItems(qo);
Assert.AreEqual(11, result.Count());
Assert.AreEqual(12, result.Count());
}

private static TfsWorkItemEndpointOptions GetTfsWorkItemEndPointOptions(string project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,8 @@ private IList<WorkItem> GetWorkItemsFromQuery(TfsWorkItemMigrationClient wiClien
}
catch (DeniedOrNotExistException ex)
{
if (ex.InnerException is WorkItemTypeDeniedOrNotExistException)
{
Log.Warning(ex, "The Work Item {id} has a Work Item Type that is in its histroy that has been subsiquently deleted! It will not be posible to migrate this item untill this has been resovled", id);
} else
{
Log.Warning(ex, "The Work Item {id} cant be accessed and returned a DeniedOrNotExistException! The specific error will be listed below.", id);
}


Log.Warning(ex, "The Work Item {id} cant be accessed for some reason and returned a DeniedOrNotExistException! The specific error will be listed below.", id);
Telemetry.TrackException(ex,
new Dictionary<string, string>
{
Expand Down

0 comments on commit 43d217d

Please sign in to comment.