Skip to content

Commit 2c8d44f

Browse files
committed
fix(cortex-cli): show YAML error instead of TOML error for skill parsing
Fixes bounty issue #1593 When parsing skill files with unknown extensions, the debug skill command would try YAML first, then TOML. If both failed, it incorrectly showed the TOML error message instead of the YAML error. Now preserves the YAML error since YAML is the primary format attempted first.
1 parent 8f839ec commit 2c8d44f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cortex-cli/src/debug_cmd.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,9 @@ async fn run_skill(args: SkillArgs) -> Result<()> {
925925
// Try YAML first, then TOML
926926
serde_yaml::from_str(&content)
927927
.map_err(|e| e.to_string())
928-
.or_else(|_| toml::from_str(&content).map_err(|e| e.to_string()))
928+
.or_else(|yaml_err| {
929+
toml::from_str(&content).map_err(|_| yaml_err) // Preserve YAML error since YAML is tried first
930+
})
929931
}
930932
};
931933

0 commit comments

Comments
 (0)