-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: Add console error messages for better logging #1364
Conversation
Kokoro seems to be stuck so attempting a re-run |
@@ -88,6 +88,7 @@ const authorizeIap = async (clientId, projectId, userAgent) => { | |||
); | |||
const tokenResponse = await res.json(); | |||
if (tokenResponse.error) { | |||
console.error(JSON.stringify(tokenResponse.error)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth adding something more explanatory to these, and printing out specific error details?
e.g.
console.error('Error in authorizeIap:', tokenResponse.error.message);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely can do that
…amples into error-logging-gcf
…dejs-docs-samples into error-logging-gcf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once (tiny) nit is fixed. 🙂
@@ -88,6 +89,7 @@ const authorizeIap = async (clientId, projectId, userAgent) => { | |||
); | |||
const tokenResponse = await res.json(); | |||
if (tokenResponse.error) { | |||
console.error('Error in token reponse:' + tokenResponse.error.message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit: use a comma instead of +
? (console.error
can take two arguments, and this is more idiomatic vs. our other samples.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, assuming error.message
is the correct object format.
(The tests should cover this, but it wouldn't hurt to verify this in GCF to be on the safe side.)
Yup - I verified this in GCF @ace-n |
#1362