Skip to content

Commit 52a1c4b

Browse files
rainersigwaldYuliiaKovalova
authored andcommitted
Switch TaskItemData exceptions (dotnet#9003)
They were NotImplementedExceptions, but that wasn't an accurate representation of why they threw, which is that write operations aren't supported on this type.
1 parent a5016b7 commit 52a1c4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Framework/TaskItemData.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public TaskItemData(ITaskItem original)
5050
IEnumerable<KeyValuePair<string, string>> IMetadataContainer.EnumerateMetadata() => Metadata;
5151

5252
void IMetadataContainer.ImportMetadata(IEnumerable<KeyValuePair<string, string>> metadata)
53-
=> throw new NotImplementedException();
53+
=> throw new InvalidOperationException($"{nameof(TaskItemData)} does not support write operations");
5454

5555
public int MetadataCount => Metadata.Count;
5656

@@ -66,7 +66,7 @@ public IDictionary CloneCustomMetadata()
6666

6767
public void CopyMetadataTo(ITaskItem destinationItem)
6868
{
69-
throw new NotImplementedException();
69+
throw new InvalidOperationException($"{nameof(TaskItemData)} does not support write operations");
7070
}
7171

7272
public string GetMetadata(string metadataName)
@@ -77,12 +77,12 @@ public string GetMetadata(string metadataName)
7777

7878
public void RemoveMetadata(string metadataName)
7979
{
80-
throw new NotImplementedException();
80+
throw new InvalidOperationException($"{nameof(TaskItemData)} does not support write operations");
8181
}
8282

8383
public void SetMetadata(string metadataName, string metadataValue)
8484
{
85-
throw new NotImplementedException();
85+
throw new InvalidOperationException($"{nameof(TaskItemData)} does not support write operations");
8686
}
8787

8888
public override string ToString()

0 commit comments

Comments
 (0)