Skip to content

Commit 8636496

Browse files
koki-developclaude
andcommitted
fix: Display field-level validation error details from CodizeApiError
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 060791c commit 8636496

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/commands/run.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,14 @@ export function registerRunCommand(program: Command): void {
130130
});
131131
} catch (err) {
132132
if (err instanceof CodizeApiError) {
133-
throw new CliError(
134-
`API error [${err.code}] ${err.message} (HTTP ${err.status})`,
135-
);
133+
let message = `API error [${err.code}] ${err.message} (HTTP ${err.status})`;
134+
if (err.errors != null && err.errors.length > 0) {
135+
const details = err.errors
136+
.map((e) => ` - ${e.path.join(".")}: ${e.message}`)
137+
.join("\n");
138+
message += "\n" + details;
139+
}
140+
throw new CliError(message);
136141
}
137142
throw err;
138143
}

0 commit comments

Comments
 (0)