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

fix: add reason field to Details in GoogleJsonErrorObject #1831

Merged
merged 3 commits into from Jun 22, 2021

Conversation

Neenu1995
Copy link
Contributor

@Neenu1995 Neenu1995 commented Jun 18, 2021

Fixes b/191502543

google-api-java-client id parsing error objects without reason field in details.
The actual error message:

{
  "error": {
    "code": 400,
    "message": "The subscription is in a state that is not valid for the requested operation",
    "status": "FAILED_PRECONDITION",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "ERROR_CODE_SUBSCRIPTION_BAD_STATE"
      }
    ]
  }
}

But when it get parsed through java api-client, it becomes:

{
  "code" : 400,
  "details" : [ {
    "@type" : "type.googleapis.com/google.rpc.ErrorInfo"
  } ],
  "message" : "The subscription is in a state that is not valid for the requested operation",
  "status" : "FAILED_PRECONDITION"
}

@Neenu1995 Neenu1995 requested a review from a team as a code owner June 18, 2021 20:55
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 18, 2021
google-api-client-bom/pom.xml Outdated Show resolved Hide resolved
google-api-client/pom.xml Outdated Show resolved Hide resolved
}

public void setReason(String reason) {
this.reason = reason;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is supposed to be nullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.

Choose a reason for hiding this comment

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

Yes

pom.xml Outdated Show resolved Hide resolved
@Neenu1995 Neenu1995 requested a review from elharo June 22, 2021 16:52
@Neenu1995 Neenu1995 added the automerge Merge the pull request once unit tests and other checks pass. label Jun 22, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 5e92b4c into master Jun 22, 2021
@gcf-merge-on-green gcf-merge-on-green bot deleted the fix-error-details branch June 22, 2021 18:08
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 22, 2021
gcf-merge-on-green bot pushed a commit that referenced this pull request Jun 24, 2021
🤖 I have created a release \*beep\* \*boop\*
---
### [1.32.1](https://www.github.com/googleapis/google-api-java-client/compare/v1.32.0...v1.32.1) (2021-06-24)


### Features

* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#1813](https://www.github.com/googleapis/google-api-java-client/issues/1813)) ([56f5b8b](https://www.github.com/googleapis/google-api-java-client/commit/56f5b8be0a60cb1cf0b279743d85ef57d9aa46b6))


### Bug Fixes

* bring comment up to date with code ([#1838](https://www.github.com/googleapis/google-api-java-client/issues/1838)) ([f150c5a](https://www.github.com/googleapis/google-api-java-client/commit/f150c5aa6e2de0c6cbad7461f4b76be8e0027567))
* Update dependencies.sh to not break on mac ([#1830](https://www.github.com/googleapis/google-api-java-client/issues/1830)) ([97940b3](https://www.github.com/googleapis/google-api-java-client/commit/97940b3fd96e343df3985630398811f3c417afcc)) 
* add reason field to Details in GoogleJsonErrorObject ([#1831](https://www.github.com/googleapis/google-api-java-client/issues/1831)) ([5e92b4c](https://www.github.com/googleapis/google-api-java-client/commit/5e92b4c22e0d45686a58de58977d20c96593e901))



### Dependencies

* don't use sp versions in the regular release ([#1840](https://www.github.com/googleapis/google-api-java-client/issues/1840)) ([94cde71](https://www.github.com/googleapis/google-api-java-client/commit/94cde719e9ad845bcd186595e06279e2b7c19096))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants