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 error handling when refresh lwa token fails, pass in debug flag to all the authorizationController #165

Merged
merged 1 commit into from
May 6, 2020

Conversation

RonWang
Copy link
Contributor

@RonWang RonWang commented May 5, 2020

This commit is to solve the error stack trace when users run ask configure but fail with the following message:

/ASK-CLI/lib/clients/lwa-auth-code-client/index.js:42
            tokenBody.expires_at = this._getExpiresAt(tokenBody.expires_in).toISOString();
                                                                            ^

RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at /ASK-CLI/lib/clients/lwa-auth-code-client/index.js:42:77

Now it fails with better message, and users are able to see full network activity using --debug for LWA requests.

@@ -92,7 +92,6 @@ function createHostedSkill(hostedSkillController, userInput, vendorId, callback)
}
skillMetadataController.enableSkill((enableErr) => {
if (enableErr) {
Messenger.getInstance().error(enableErr);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is a little out of the context, but I noticed when I run unit test. This error will anyway be displayed in the upstream, so it's duplicate

@kakhaUrigashvili kakhaUrigashvili self-requested a review May 6, 2020 00:05
@kakhaUrigashvili kakhaUrigashvili merged commit 87c8350 into develop May 6, 2020
@kakhaUrigashvili kakhaUrigashvili deleted the use_debug_for_lwa branch May 6, 2020 00:06
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.

2 participants