Skip to content

Show OperationID from CloudException thrown by Compute Cmdlets #546

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 29 commits into from
Jul 1, 2015

Conversation

huangpf
Copy link
Contributor

@huangpf huangpf commented Jun 26, 2015

No description provided.

@azurecla
Copy link

Hi @huangpf, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!


It looks like you're working at Microsoft (phuang). If you're full-time, we DON'T require a contribution license agreement.



If you are a vendor, or work for Microsoft Open Technologies, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;

@huangpf huangpf changed the title [do not merge; review only] [do not merge; review only] Show OperationID from CloudException thrown by Compute Cmdlets [do not merge; review only] Show OperationID from CloudException thrown by Compute Cmdlets Jun 26, 2015
AzureRT and others added 4 commits June 25, 2015 20:28
Fix Start/Stop/Update-AzureVM
AzureRT S51 - Include OperationID in CloudException Message
Properties.Resources.ComputeCloudExceptionOperationIdMessage,
headers[RequestIdHeaderInResponse].FirstOrDefault());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. you can do the same thing with a little bit less code:

var sb = new StringBuilder();

if(!string.IsNullOrEmpty(cloudException.Message))
{
    sb.AppendLine(cloudException.Message);
}

if (cloudException.Response != null && 
    cloudException.Response.Headers != null)
{
    var headers = cloudException.Response.Headers;
    if (headers.ContainsKey(RequestIdHeaderInResponse))
    {
        sb.AppendFormat(
            Properties.Resources.ComputeCloudExceptionOperationIdMessage,
            headers[RequestIdHeaderInResponse].FirstOrDefault());
    }
} 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. Thanks!

WriteObject(result);
}
if (this.Force.IsPresent
|| this.ShouldContinue(Properties.Resources.AvailabilitySetRemovalConfirmation,
Copy link
Contributor

Choose a reason for hiding this comment

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

please move the OR (||) on the line 55. There are several places with this type of line break. Please change them all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK.

@hovsepm
Copy link
Contributor

hovsepm commented Jun 30, 2015

LGTM

@huangpf huangpf changed the title [do not merge; review only] Show OperationID from CloudException thrown by Compute Cmdlets Show OperationID from CloudException thrown by Compute Cmdlets Jun 30, 2015
stankovski added a commit that referenced this pull request Jul 1, 2015
Show OperationID from CloudException thrown by Compute Cmdlets
@stankovski stankovski merged commit b8923d5 into Azure:dev Jul 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants