Skip to content

Commit 90b46d8

Browse files
[OperationalInsights] Cluster Validation change and extended error msg (#17634)
* remove cmdlet validation on cluster capacity * expand error msg and changelog update * Update src/OperationalInsights/OperationalInsights/ChangeLog.md Co-authored-by: Beisi Zhou <[email protected]> Co-authored-by: Beisi Zhou <[email protected]>
1 parent 39560c3 commit 90b46d8

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/OperationalInsights/OperationalInsights/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Removed capacity validation in new and update cluster cmdlets as validation exists on server side.
23+
* Extended error message on base class for extended information.
2224
* Bug fix - prevent exceptions while using StorageInsight cmdlets.
2325
* Bug fix - when updating a cluster, it's SKU was set even if no value was passed.
2426

src/OperationalInsights/OperationalInsights/Models/PSClusterSku.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ private void ValidateCapacity()
5252
throw new PSArgumentException($"Sku name only supports: {AllowedClusterServiceTiers.CapacityReservation} ");
5353
}
5454

55-
if (this.Capacity < 1000)
56-
{
57-
throw new PSArgumentException("SkuCapacity need to be more than 1000 GB ");
58-
}
59-
6055
if (this.Capacity % 100 != 0)
6156
{
6257
throw new PSArgumentException("SkuCapacity need to be multiple of 100 ");

src/OperationalInsights/OperationalInsights/OperationalInsightsBaseCmdlet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ protected override void WriteExceptionError(Exception exception)
6868
// Override the default error message so it will include information passed from Backend
6969
Management.OperationalInsights.Models.ErrorResponseException errorException = exception as Management.OperationalInsights.Models.ErrorResponseException;
7070
if (errorException != null)
71-
{
72-
exception = new Exception(string.Format("{0}\n{1}", errorException.Message, errorException.Response.ReasonPhrase), errorException);
71+
{
72+
exception = new Exception(string.Format("{0}\n{1}\n{2}", errorException.Message, errorException.Response?.ReasonPhrase, errorException.Response?.Content), errorException);
7373
}
7474
base.WriteExceptionError(exception);
7575
}

0 commit comments

Comments
 (0)