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: Raise exception on error from iam_sign_endpoint #880

Closed
wants to merge 1 commit into from

Conversation

bgirschig
Copy link

Raise an exception when the sign_bytes function of an impersonated credential gets an error from the iam_sign_endpoint.

(currently, it fails with a KeyError exception)

Raise an exception when the sign_bytes function of an impersonated credential gets an error from the iam_sign_endpoint.

(currently, it fails with a KeyError exception)
@bgirschig bgirschig requested review from arithmetic1728, silvolu and a team as code owners October 1, 2021 11:12
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 1, 2021
response_data = response.json()

if "error" in response:
raise Exception(response_data["error"])
Copy link
Contributor

Choose a reason for hiding this comment

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

The exception type should be based on the status code from the response (which we ought to be checking before extracting JSON, anyway).

We will also need one or more new tests for the error case.

@arithmetic1728
Copy link
Contributor

fixed in #905

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.

3 participants