Skip to content

Commit f07f059

Browse files
committed
fix: include resource_id and index in validation error messages
1 parent 627f08e commit f07f059

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/cli/src/tasks/validate.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ export const ValidateTask = (): ListrTask<{
2828
lines.push(result.errorMessage);
2929
}
3030
for (const e of result.errors) {
31-
const id = e.resource_id ? ` "${e.resource_id}"` : '';
32-
lines.push(` - [${e.resource_type}${id}]: ${e.error}`);
31+
const parts: string[] = [e.resource_type];
32+
if (e.resource_id) parts.push(`id="${e.resource_id}"`);
33+
if (e.index !== undefined) parts.push(`index=${e.index}`);
34+
lines.push(` - [${parts.join(', ')}]: ${e.error}`);
3335
}
3436
const error = new Error(
3537
`Configuration validation failed:\n${lines.join('\n')}`,

0 commit comments

Comments
 (0)