Skip to content
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

Merged
merged 7 commits into from
Jun 14, 2019
Merged

Conversation

leahecole
Copy link
Contributor

@leahecole leahecole requested a review from grayside June 12, 2019 21:16
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 12, 2019
@leahecole leahecole added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 12, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 12, 2019
@leahecole
Copy link
Contributor Author

Kokoro seems to be stuck so attempting a re-run

@leahecole leahecole added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2019
@leahecole leahecole requested a review from ace-n June 13, 2019 19:01
@@ -88,6 +88,7 @@ const authorizeIap = async (clientId, projectId, userAgent) => {
);
const tokenResponse = await res.json();
if (tokenResponse.error) {
console.error(JSON.stringify(tokenResponse.error));
Copy link
Contributor

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);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely can do that

@leahecole leahecole requested a review from ace-n June 13, 2019 22:11
Copy link
Contributor

@ace-n ace-n left a 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);
Copy link
Contributor

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.)

Copy link
Contributor

@ace-n ace-n left a 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.)

@leahecole
Copy link
Contributor Author

Yup - I verified this in GCF @ace-n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants