Skip to content

Commit cccbe65

Browse files
committed
fix: update ZodError.errors to .issues for Zod v4 compat
Zod v4 renamed ZodError.errors to ZodError.issues. Update all 3 error handlers and regenerate bun.lock.
1 parent c7093f9 commit cccbe65

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

bun.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function loadConfig(): Promise<MCConfig> {
6060
return result;
6161
} catch (error) {
6262
if (error instanceof z.ZodError) {
63-
throw new Error(`Invalid config in ${filePath}: ${error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`);
63+
throw new Error(`Invalid config in ${filePath}: ${error.issues.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`);
6464
}
6565
throw new Error(`Failed to load config from ${filePath}: ${error}`);
6666
}

src/lib/job-state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export async function loadJobState(): Promise<JobState> {
7676
return JobStateSchema.parse(parsed);
7777
} catch (error) {
7878
if (error instanceof z.ZodError) {
79-
throw new Error(`Invalid job state in ${filePath}: ${error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`);
79+
throw new Error(`Invalid job state in ${filePath}: ${error.issues.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`);
8080
}
8181
throw new Error(`Failed to load job state from ${filePath}: ${error}`);
8282
}

src/lib/plan-state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function loadPlan(): Promise<PlanSpec | null> {
3333
return PlanSpecSchema.parse(parsed);
3434
} catch (error) {
3535
if (error instanceof z.ZodError) {
36-
throw new Error(`Invalid plan state in ${filePath}: ${error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`);
36+
throw new Error(`Invalid plan state in ${filePath}: ${error.issues.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`);
3737
}
3838
throw new Error(`Failed to load plan state from ${filePath}: ${error}`);
3939
}

0 commit comments

Comments
 (0)