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: when add remote skill show manifest json parse error #7396

Merged
merged 12 commits into from
Apr 28, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ export const getSkillManifest = async (projectId: string, manifestUrl: string, s
});
setSkillManifest(data);
} catch (error) {
setFormDataErrors({ ...error, manifestUrl: formatMessage('Manifest URL can not be accessed') });
const httpMessage = error?.response?.data?.message;
const message = httpMessage?.match('Unexpected string in JSON')
? formatMessage("Error attempting to parse Skill manifest. There could be an error in it's format.")
: formatMessage('Manifest URL can not be accessed');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @cwhitten , I made some update base on your change here . Is this your intention?

Copy link
Member

Choose a reason for hiding this comment

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

Yes thank you @zhixzhan !


setFormDataErrors({ ...error, manifestUrl: message });
}
};
const getTriggerFormData = (intent: string, content: string): TriggerFormData => ({
Expand Down