Skip to content

Commit 41b9549

Browse files
authored
chore: add accurate error message when current active profile does not match a profile configured in the skill
1 parent 9f09357 commit 41b9549

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/utils/skillHelper.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ export function getSkillMetadataSrc(folderPath: string, profile: string): {skill
6868
skillPackageSrc = SKILL_FOLDER.SKILL_PACKAGE.NAME;
6969
return {skillPackageAbsPath, skillPackageSrc};
7070
}
71+
72+
const allProfiles = R.keys(R.path(["profiles"], skillResource));
73+
if(!allProfiles.includes(profile)){
74+
throw logAskError(
75+
`Currently active profile, '${profile}', was not found in 'ask-resources.json'. Profiles configured for this skill: '${allProfiles}'. ` +
76+
`Please ensure that the name of your active profile, '${profile}', matches a profile configured in 'ask-resources.json' and '.ask/ask-states.json'`,
77+
);
78+
}
79+
7180
skillPackageSrc = R.path(["profiles", profile, "skillMetadata", "src"], skillResource);
7281
if (skillPackageSrc === undefined) {
7382
throw logAskError(

0 commit comments

Comments
 (0)