Skip to content

Commit f057796

Browse files
authored
Fix error handling in Remove-PnPTeamsChannel (#4036)
Fix Remove-PnPTeamsChannel error handling mismatch between "Team not found", "Channel not found" and no error.
1 parent 5b1b025 commit f057796

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Commands/Teams/RemoveTeamsChannel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ protected override void ExecuteCmdlet()
4848
WriteError(new ErrorRecord(new Exception($"Channel remove failed"), "REMOVEFAILED", ErrorCategory.InvalidResult, this));
4949
}
5050
}
51-
else
52-
{
53-
throw new PSArgumentException("Channel not found");
54-
}
5551
}
5652
else
5753
{
58-
throw new PSArgumentException("Team not found");
54+
throw new PSArgumentException("Channel not found");
5955
}
6056
}
57+
else
58+
{
59+
throw new PSArgumentException("Team not found");
60+
}
6161
}
6262
}
6363
}

0 commit comments

Comments
 (0)