Skip to content

ref(google-cloud-serverless): Use debug instead of logger #17026

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

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

AbhiPrasad
Copy link
Member

resolves #16948

@AbhiPrasad AbhiPrasad requested a review from a team July 15, 2025 19:48
@AbhiPrasad AbhiPrasad self-assigned this Jul 15, 2025
@AbhiPrasad AbhiPrasad requested review from Lms24 and msonnb and removed request for a team July 15, 2025 19:48
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Incorrect Error Logging Method Usage

The replacement of logger.error with debug.error in http.ts, events.ts, and cloud_events.ts is incorrect. debug (from @sentry/core) is a function, not an object with an error method. This results in TypeError: debug.error is not a function at runtime (when DEBUG_BUILD is true) or TypeScript compilation errors, preventing error logging when flush() rejects.

packages/google-cloud-serverless/src/gcpfunction/events.ts#L57-L63

span.end();
// eslint-disable-next-line @typescript-eslint/no-floating-promises
flush(options.flushTimeout)
.then(null, e => {
DEBUG_BUILD && debug.error(e);
})

packages/google-cloud-serverless/src/gcpfunction/cloud_events.ts#L57-L60

flush(options.flushTimeout)
.then(null, e => {
DEBUG_BUILD && debug.error(e);
})

packages/google-cloud-serverless/src/gcpfunction/http.ts#L67-L72

// eslint-disable-next-line @typescript-eslint/no-floating-promises
flush(flushTimeout)
.then(null, e => {
DEBUG_BUILD && debug.error(e);
})

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@andreiborza andreiborza merged commit 713ef4b into develop Jul 16, 2025
35 checks passed
@andreiborza andreiborza deleted the abhi-debug-google-cloud-serverless branch July 16, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate google-cloud-serverless package to use debug
3 participants