mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-11 17:40:14 +01:00
ComfyUI: Log error details on prompt submission
This commit is contained in:
parent
87f2a9e630
commit
b2b5c1f10c
@ -7,7 +7,7 @@ import sanitize from 'sanitize-filename';
|
||||
import { sync as writeFileAtomicSync } from 'write-file-atomic';
|
||||
import FormData from 'form-data';
|
||||
|
||||
import { delay, getBasicAuthHeader } from '../util.js';
|
||||
import { delay, getBasicAuthHeader, tryParse } from '../util.js';
|
||||
import { jsonParser } from '../express-common.js';
|
||||
import { readSecret, SECRET_KEYS } from './secrets.js';
|
||||
|
||||
@ -535,7 +535,8 @@ comfy.post('/generate', jsonParser, async (request, response) => {
|
||||
body: request.body.prompt,
|
||||
});
|
||||
if (!promptResult.ok) {
|
||||
throw new Error('ComfyUI returned an error.');
|
||||
const text = await promptResult.text();
|
||||
throw new Error('ComfyUI returned an error.', { cause: tryParse(text) });
|
||||
}
|
||||
|
||||
/** @type {any} */
|
||||
|
Loading…
x
Reference in New Issue
Block a user