Files
windmill/frontend/src/lib/components/copilot/chat/utils.ts
T
HugoCasa 68ebf667d5 feat: ai flow chat (#5842)
* feat: ai flow chat

* youpi

* feat: preprocessor and error handler support

* fix: reactivity

* feat: inline script editor cmd l

* nit

* fix: apply in script editor

* fixes

* prompt nits
2025-06-02 22:14:25 +02:00

18 lines
339 B
TypeScript

import { z } from 'zod'
const errorSchema = z.object({
error: z.any()
})
export function getStringError(result: unknown): string | undefined {
try {
const parsed = errorSchema.parse(result)
if (parsed.error) {
return JSON.stringify(parsed.error, null, 2)
} else {
return undefined
}
} catch (_) {
return undefined
}
}