Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

err.code type changes from 'string' to 'number'. #1092

@scschl

Description

@scschl

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.

  1. 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.

  2. Did someone already solve this?

  1. Do you have a support contract?
    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

  • OS: Windows 10.0.18362
  • Node.js version: 12.13.0
  • npm version: 6.12.0
  • google-auth-library version: 6.1.1.

Steps to reproduce

  1. Call google.classroom("v1").courses.list(), or any related API (courses.teacher, courses.student, etc.)
  2. Keep calling until a quota threshold is reached (should get a 429 error code).
  3. Look at the typeof the error.code returned. It will be a 'number', but should be a 'string'.

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!

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions