mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
section 6: Phase 6: Config.Info validation owner and v2 config types in
This commit is contained in:
1 parent
66b5d1ac06
commit
48ca38c4e3
16 files changed
+232
-79
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import { Hono, type Context } from 'hono'
|
||||
import { z } from 'zod'
|
||||
import {
|
||||
UpdateOpenCodeConfigPatchRequestSchema,
|
||||
UpdateOpenCodeConfigRequestSchema,
|
||||
@@ -20,6 +19,7 @@ import {
|
||||
OpenCodeConfigRedactedValueError,
|
||||
OpenCodeConfigShadowedRemovalError,
|
||||
OpenCodeConfigSourceInvalidError,
|
||||
OpenCodeConfigValidationError,
|
||||
readOpenCodeConfigFile,
|
||||
withOpenCodeConfigLock,
|
||||
} from '../services/opencode-config-file'
|
||||
@@ -198,8 +198,8 @@ async function applyUpdate(
|
||||
if (error instanceof OpenCodeConfigRedactedValueError) {
|
||||
return c.json({ error: error.message, paths: error.paths }, 400)
|
||||
}
|
||||
if (error instanceof z.ZodError) {
|
||||
return c.json({ error: 'Invalid config data', details: error.issues }, 400)
|
||||
if (error instanceof OpenCodeConfigValidationError) {
|
||||
return c.json({ error: 'Invalid config data', validationIssues: error.issues }, 400)
|
||||
}
|
||||
if (error instanceof SyntaxError) {
|
||||
return c.json({ error: 'Invalid config data', details: error.message }, 400)
|
||||
|
||||
Reference in new issue
Block a user