-
Notifications
You must be signed in to change notification settings - Fork 375
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
err.code type changes from 'string' to 'number'. #1092
Comments
@scschl I would expect |
Yes, it seems inconsistent that sometimes 'code' is a string and other times it's a 'number'. The types indicate it should be a string: export interface RequestError extends GaxiosError { export declare class GaxiosError<T = any> extends Error { |
Also, if it's expected to be a number, why is it explicitly converted to a string if the status is >=400 ? else if (res && res.status >= 400) { |
@scschl we intend to address this issue, but all the fixes we could think of would be a breaking change for many of our libraries. Are you able to workaround the issue today by running |
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Is this a client library issue or a product issue?
This is the client library for . We will only be able to assist with issues that pertain to the behaviors of this library. If the issue you're experiencing is due to the behavior of the product itself, please visit the Support page to reach the most relevant engineers.
Did someone already solve this?
Please create an issue in the support console to ensure a timely response.
If the support paths suggested above still do not result in a resolution, please provide the following details.
Environment details
google-auth-library
version: 6.1.1.Steps to reproduce
Looks like
err.code = body.error.code;
around line 95 in processError() in transporters.js needs to ensure the assigned value is a string.
Line 112 handles this by calling toString(). Might be other lines that need to ensure the code field is a string type.
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
The text was updated successfully, but these errors were encountered: