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: return error code as a string #1587

Closed
wants to merge 4 commits into from
Closed

fix: return error code as a string #1587

wants to merge 4 commits into from

Conversation

sofisl
Copy link
Contributor

@sofisl sofisl commented Jul 10, 2023

@sofisl sofisl requested review from a team as code owners July 10, 2023 23:03
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Jul 10, 2023
@sofisl sofisl changed the title Fix branch error fix!: return error code as a string Jul 10, 2023
Comment on lines +105 to +109
err.code = body.error.code.toString();
err.errors = body.error.errors;
} else {
err.message = body.error.message;
err.code = body.error.code || res.status;
err.code = body.error.code.toString() || res.status.toString();
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair, but it seems like Gaxios expects a string: https://github.com/googleapis/gaxios/blob/18a48fc298c8d0e707b7f6e5cd892cb7c239f1db/src/common.ts#L21

SHould we close this as WAI? #1092

@sofisl sofisl changed the title fix!: return error code as a string fix: return error code as a string Jul 11, 2023
@sofisl sofisl closed this Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: update GaxiosError code to include a string or a number
3 participants