fix(site): improve error handling for /contact - #1017
Open
BaoT1301 wants to merge 2 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The public inquiry action on /contact forwarded the caught error's raw
message straight to the client via throwActionError(err.message). That
can surface internal details to end users, such as upstream HTTP status
codes, a missing CONTACT_GOOGLE_SCRIPT_URL config error, or other
exception text that should never leave the server.
Now the full error is still logged server-side with logger.error for
diagnosis, but the caller receives a fixed, generic message ("We could
not submit your inquiry right now. Please try again later.") regardless
of the underlying failure.
Updated the failure test to assert the generic message is thrown, that
the raw internal message is not surfaced, and that the full error is
still logged.
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.
Description
Fixes #740
The public inquiry action on
/contactforwarded the caught error's raw message directly to the client:That can leak internal details to end users (upstream HTTP status codes, a missing
CONTACT_GOOGLE_SCRIPT_URLconfig error, or other exception text that should never leave the server).What changed
logger.errorfor diagnosis.Tests
Sheets is down) is not surfaced to the caller, and that the full internal error is still logged server-side.No UI or behavior change beyond the error text the user sees on a failed submission.
Checklist