Repository navigation
fix(storage-resize-images): log errors that escape the trigger at ERROR severity - #3281
Merged
Merged
Conversation
…OR severity An error thrown before the resize, such as an invalid SHARP_OPTIONS, reached the logs only as unstructured stderr. Log it with logger.error and rethrow, and note in the README that 2nd gen failures should be alerted on from logs.
Contributor
There was a problem hiding this comment.
Code Review
This pull request improves error handling and logging for the 2nd generation generateResizedImage Cloud Function to ensure unhandled errors are logged at ERROR severity, allowing for reliable log-based alerting. It updates the README with alerting guidelines, adds an unhandledError logger helper, and introduces corresponding unit tests. Feedback suggests importing logger from "firebase-functions" instead of "firebase-functions/v2" in the test file to maintain consistency with the main codebase.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
IzaakGough
marked this pull request as ready for review
October 26, 2026 15:00
CorieW
reviewed
Oct 26, 2026
Matches the extension's ERROR entry so Error Reporting groups each failure once. The README now says that failed events are always recorded as HTTP 200 and that timeouts are never logged at ERROR.
CorieW
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3267.
When the kit failed before resizing, for example with an invalid
SHARP_OPTIONS, the error appeared in Cloud Logging with no severity, so error alerts never fired.This logs any such error at ERROR severity before failing, and the README now recommends alerting on logs.
Tested with unit tests and a live deploy, where an invalid
SHARP_OPTIONSlogged at ERROR. Timeouts and out-of-memory kills were not tested.