Skip to content

[OperationalInsights] Cluster Validation change and extended error msg #17634

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/OperationalInsights/OperationalInsights/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
-->

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ private void ValidateCapacity()
throw new PSArgumentException($"Sku name only supports: {AllowedClusterServiceTiers.CapacityReservation} ");
}

if (this.Capacity < 1000)
{
throw new PSArgumentException("SkuCapacity need to be more than 1000 GB ");
}

if (this.Capacity % 100 != 0)
{
throw new PSArgumentException("SkuCapacity need to be multiple of 100 ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ protected override void WriteExceptionError(Exception exception)
// Override the default error message so it will include information passed from Backend
Management.OperationalInsights.Models.ErrorResponseException errorException = exception as Management.OperationalInsights.Models.ErrorResponseException;
if (errorException != null)
{
exception = new Exception(string.Format("{0}\n{1}", errorException.Message, errorException.Response.ReasonPhrase), errorException);
{
exception = new Exception(string.Format("{0}\n{1}\n{2}", errorException.Message, errorException.Response?.ReasonPhrase, errorException.Response?.Content), errorException);
}
base.WriteExceptionError(exception);
}
Expand Down