Use new error dialog for queue prompt errors (#3266)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2025-03-28 13:51:00 -04:00
committed by GitHub
parent 504b717575
commit 04af8cda4d
11 changed files with 87 additions and 51 deletions

View File

@@ -255,14 +255,26 @@ export function validateTaskItem(taskItem: unknown) {
const zEmbeddingsResponse = z.array(z.string())
const zExtensionsResponse = z.array(z.string())
const zError = z.object({
type: z.string(),
message: z.string(),
details: z.string(),
extra_info: z.record(z.string(), z.any())
})
const zNodeError = z.object({
errors: z.array(zError),
class_type: z.string(),
dependent_outputs: z.array(z.any())
})
const zPromptResponse = z.object({
node_errors: z.array(z.string()).optional(),
node_errors: z.record(zNodeId, zNodeError).optional(),
prompt_id: z.string().optional(),
exec_info: z
.object({
queue_remaining: z.number().optional()
})
.optional()
.optional(),
error: z.union([z.string(), zError])
})
const zDeviceStats = z.object({
@@ -414,6 +426,7 @@ const zSettings = z.record(z.any()).and(
export type EmbeddingsResponse = z.infer<typeof zEmbeddingsResponse>
export type ExtensionsResponse = z.infer<typeof zExtensionsResponse>
export type PromptResponse = z.infer<typeof zPromptResponse>
export type NodeError = z.infer<typeof zNodeError>
export type Settings = z.infer<typeof zSettings>
export type DeviceStats = z.infer<typeof zDeviceStats>
export type SystemStats = z.infer<typeof zSystemStats>