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

Remove body field from RestError Object in core-http Library #5670

Merged
merged 4 commits into from
Oct 20, 2019

Conversation

sarangan12
Copy link
Member

@sarangan12 sarangan12 commented Oct 19, 2019

Per recent conversation with @ramya-rao-a I am removing the body field from RestError Object in core-http Library. If required, this can be read from the response object.

Additional details:
With #5437,

  • the response property on the error will now have the parsed body & headers along with raw body & headers that it already had.
  • the details property on the error will have the shape/data model as defined in swagger for errors

With these changes, the body property on the RestError itself becomes redundant.

@sarangan12 sarangan12 marked this pull request as ready for review October 19, 2019 00:18
Copy link
Member

@bterlson bterlson left a comment

Choose a reason for hiding this comment

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

Conservative is better. +1!

@Azure Azure deleted a comment from azure-pipelines bot Oct 19, 2019
@sarangan12
Copy link
Member Author

/azp run js - core - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Azure Azure deleted a comment from azure-pipelines bot Oct 19, 2019
error.body = this._pollState.resource;
if (error.body) {
const innerError: any = error.body.error;
error.response.parsedBody = this._pollState.resource;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use the error.details here instead?
this._pollState.resource is not really the parsed body of the response here right?

@sadasant, @chradek, @bterlson

Copy link
Member

Choose a reason for hiding this comment

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

details seems appropriate to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

On second thoughts this._pollState.resource has already been updated to parsed response body elsewhere, so this is ok for now, but needs deeper investigation. Opened issue #5680

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.

3 participants