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

Conversation

@alexander-fenster
Copy link
Contributor

@alexander-fenster alexander-fenster commented Mar 9, 2023

Fixes googleapis/google-cloud-node-core#252.

In REST streaming use case, callback is not provided. Instead, the caller expects to see error events in the returned stream. If, for whatever reason, an error occurs in the streaming call, the caller would get TypeError: callback is not a function.

Make sure we only call callback if it's provided, and use the stream emitter to report errors in other cases.

Note: the unrelated change to mkdirp import is just because they are apparently making ESM related changes. It just makes our code compile again.

@alexander-fenster alexander-fenster requested review from a team as code owners March 9, 2023 21:01
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Mar 9, 2023
@alexander-fenster alexander-fenster requested a review from sofisl March 9, 2023 21:01
@alexander-fenster alexander-fenster merged commit 193b387 into main Mar 10, 2023
@alexander-fenster alexander-fenster deleted the callback-is-not branch March 10, 2023 01:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REST transport: callback is not a function

4 participants