ComfyUI: Log error details on prompt submission
| @@ -7,7 +7,7 @@ import sanitize from 'sanitize-filename'; | ||
| 7 | 7 | import { sync as writeFileAtomicSync } from 'write-file-atomic'; |
| 8 | 8 | import FormData from 'form-data'; |
| 9 | 9 | |
| 10 | 10 | import { delay, getBasicAuthHeader, tryParse } from '../util.js'; |
| 11 | 11 | import { jsonParser } from '../express-common.js'; |
| 12 | 12 | import { readSecret, SECRET_KEYS } from './secrets.js'; |
| 13 | 13 | |
| @@ -535,7 +535,8 @@ comfy.post('/generate', jsonParser, async (request, response) => { | ||
| 535 | 535 | body: request.body.prompt, |
| 536 | 536 | }); |
| 537 | 537 | if (!promptResult.ok) { |
| 538 | - throw new Error('ComfyUI returned an error.'); | |
| 538 | + const text = await promptResult.text(); | |
| 539 | + throw new Error('ComfyUI returned an error.', { cause: tryParse(text) }); | |
| 539 | 540 | } |
| 540 | 541 | |
| 541 | 542 | /** @type {any} */ |