Skip to content

Commit c9de959

Browse files
committed
fix: update error handling code for Zod API changes
- Update error handling code to match latest Zod API - Change result.error.errors to result.error.issues - Improve variable naming clarity (e → issue, path → pathStr) refs #113
1 parent ac76090 commit c9de959

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/mcp-server/src/rules/agent.schema.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ export function parseAgentProfile(data: unknown): ValidatedAgentProfile {
130130
const result = AgentProfileSchema.safeParse(data);
131131

132132
if (!result.success) {
133-
const errorMessage = result.error.errors
134-
.map(e => {
135-
const path = e.path.length > 0 ? e.path.join('.') : 'root';
136-
return `${path}: ${e.message}`;
133+
const errorMessage = result.error.issues
134+
.map(issue => {
135+
const pathStr = issue.path.length > 0 ? issue.path.join('.') : 'root';
136+
return `${pathStr}: ${issue.message}`;
137137
})
138138
.join(', ');
139139
throw new AgentSchemaError(

0 commit comments

Comments
 (0)