-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
There was a problem hiding this 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!
/azp run js - core - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
error.body = this._pollState.resource; | ||
if (error.body) { | ||
const innerError: any = error.body.error; | ||
error.response.parsedBody = this._pollState.resource; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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,
response
property on the error will now have the parsed body & headers along with raw body & headers that it already had.details
property on the error will have the shape/data model as defined in swagger for errorsWith these changes, the
body
property on theRestError
itself becomes redundant.