Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Peering] Add API version 2020-10-01 #14714

Merged
merged 16 commits into from
Apr 20, 2021
11 changes: 6 additions & 5 deletions src/Peering/Peering/Common/PeeringBaseCmdlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Peering.Common

using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
using Microsoft.Azure.Commands.Common.Exceptions;
using Microsoft.Azure.Commands.Peering.Properties;
using Microsoft.Azure.Commands.ResourceManager.Common;
using Microsoft.Azure.Management.Peering;
Expand Down Expand Up @@ -318,9 +319,9 @@ public PSCdnPeeringPrefix ToPSCdnPeeringPrefix(object cdnPrefix)
{
return PeeringResourceManagerProfile.Mapper.Map<PSCdnPeeringPrefix>(cdnPrefix);
}
catch (InvalidOperationException mapException)
catch (AzPSInvalidOperationException mapException)
Copy link
Contributor

@VeryEarly VeryEarly Apr 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should still be InvalidOperationException

{
throw new InvalidOperationException(String.Format(Resources.Error_Mapping, mapException));
throw new AzPSInvalidOperationException(String.Format(Resources.Error_Mapping, mapException));
}
}

Expand All @@ -339,10 +340,10 @@ public bool ValidBandwidth(int? bandwidthInMbps)
{
this.WriteVerbose($"validating bandwidth: {bandwidthInMbps}");
if (bandwidthInMbps <= 0)
throw new PSArgumentException(string.Format(Resources.Error_BandwidthTooLow, bandwidthInMbps));
throw new AzPSArgumentException(string.Format(Resources.Error_BandwidthTooLow, bandwidthInMbps), "bandwidthInMbps");
if (bandwidthInMbps % Constants.MinRange != 0)
throw new PSArgumentException(
string.Format(Resources.Error_BandwidthIncorrectFormat, bandwidthInMbps, Constants.MinRange));
throw new AzPSArgumentOutOfRangeException(
string.Format(Resources.Error_BandwidthIncorrectFormat, bandwidthInMbps, Constants.MinRange), "bandwidthInMbps");
return true;
}

Expand Down