File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -258,9 +258,30 @@ export async function configYamlToContinueConfig(options: {
258258 continueConfig . slashCommands ?. push ( slashCommand ) ;
259259 }
260260 } catch ( e ) {
261+ // If the file is in a rules directory, we can provide a more helpful error message
262+ // because we know it's likely a rule definition
263+ const isRuleFile =
264+ file . path . toLowerCase ( ) . includes ( "/rules/" ) ||
265+ file . path . toLowerCase ( ) . includes ( "\\rules\\" ) ;
266+
267+ let message = `Failed to convert prompt file ${ file . path } to slash command: ${ e instanceof Error ? e . message : e } ` ;
268+
269+ if ( isRuleFile ) {
270+ const isYamlError =
271+ e instanceof Error &&
272+ ( e . name ?. includes ( "YAML" ) || e . message . includes ( "flow sequence" ) ) ;
273+
274+ const prefix = isYamlError
275+ ? "Failed to parse rule definition"
276+ : "Failed to process rule definition" ;
277+
278+ const errorDetails = e instanceof Error ? e . message : String ( e ) ;
279+ message = `${ prefix } ${ file . path } : ${ errorDetails } ` ;
280+ }
281+
261282 localErrors . push ( {
262283 fatal : false ,
263- message : `Failed to convert prompt file ${ file . path } to slash command: ${ e instanceof Error ? e . message : e } ` ,
284+ message,
264285 } ) ;
265286 }
266287 } ) ;
You can’t perform that action at this time.
0 commit comments