fix: prompt error
This commit is contained in:
parent
04fd08d5ba
commit
62df715655
@ -25,8 +25,10 @@ import struct
|
|||||||
|
|
||||||
from logging import basicConfig, getLogger
|
from logging import basicConfig, getLogger
|
||||||
import logfire
|
import logfire
|
||||||
if os.environ.get('LOGFIRE_TOKEN', None) is not None:
|
# if os.environ.get('LOGFIRE_TOKEN', None) is not None:
|
||||||
logfire.configure()
|
logfire.configure(
|
||||||
|
send_to_logfire="if-token-present"
|
||||||
|
)
|
||||||
# basicConfig(handlers=[logfire.LogfireLoggingHandler()])
|
# basicConfig(handlers=[logfire.LogfireLoggingHandler()])
|
||||||
logfire_handler = logfire.LogfireLoggingHandler()
|
logfire_handler = logfire.LogfireLoggingHandler()
|
||||||
logger = getLogger("comfy-deploy")
|
logger = getLogger("comfy-deploy")
|
||||||
@ -323,7 +325,7 @@ async def stream_prompt(data):
|
|||||||
# When there are critical errors, the prompt is actually not run
|
# When there are critical errors, the prompt is actually not run
|
||||||
await update_run(prompt_id, Status.FAILED)
|
await update_run(prompt_id, Status.FAILED)
|
||||||
# return web.Response(status=500, reason=f"{error_type}: {e}, {stack_trace_short}")
|
# return web.Response(status=500, reason=f"{error_type}: {e}, {stack_trace_short}")
|
||||||
raise Exception("Prompt failed")
|
# raise Exception("Prompt failed")
|
||||||
|
|
||||||
status = 200
|
status = 200
|
||||||
|
|
||||||
@ -339,7 +341,7 @@ async def stream_prompt(data):
|
|||||||
# When there are critical errors, the prompt is actually not run
|
# When there are critical errors, the prompt is actually not run
|
||||||
if "error" in res:
|
if "error" in res:
|
||||||
await update_run(prompt_id, Status.FAILED)
|
await update_run(prompt_id, Status.FAILED)
|
||||||
raise Exception("Prompt failed")
|
# raise Exception("Prompt failed")
|
||||||
|
|
||||||
return res
|
return res
|
||||||
# return web.json_response(res, status=status)
|
# return web.json_response(res, status=status)
|
||||||
|
|||||||
@ -15,7 +15,32 @@ function sendEventToCD(event, data) {
|
|||||||
|
|
||||||
function dispatchAPIEventData(data) {
|
function dispatchAPIEventData(data) {
|
||||||
const msg = JSON.parse(data);
|
const msg = JSON.parse(data);
|
||||||
|
|
||||||
|
// Custom parse error
|
||||||
|
if (msg.error) {
|
||||||
|
let message = msg.error.message;
|
||||||
|
if (msg.error.details)
|
||||||
|
message += ": " + msg.error.details;
|
||||||
|
for (const [nodeID, nodeError] of Object.entries(
|
||||||
|
msg.node_errors,
|
||||||
|
)) {
|
||||||
|
message += "\n" + nodeError.class_type + ":";
|
||||||
|
for (const errorReason of nodeError.errors) {
|
||||||
|
message +=
|
||||||
|
"\n - " + errorReason.message + ": " + errorReason.details;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
app.ui.dialog.show(message);
|
||||||
|
if (error.response) {
|
||||||
|
app.lastNodeErrors = msg.node_errors;
|
||||||
|
app.canvas.draw(true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (msg.event) {
|
switch (msg.event) {
|
||||||
|
case "error":
|
||||||
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
if (msg.data.sid) {
|
if (msg.data.sid) {
|
||||||
// this.clientId = msg.data.sid;
|
// this.clientId = msg.data.sid;
|
||||||
@ -52,8 +77,8 @@ function dispatchAPIEventData(data) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
api.dispatchEvent(new CustomEvent(msg.type, { detail: msg.data }));
|
api.dispatchEvent(new CustomEvent(msg.type, { detail: msg.data }));
|
||||||
// default:
|
// default:
|
||||||
// if (this.#registered.has(msg.type)) {
|
// if (this.#registered.has(msg.type)) {
|
||||||
// } else {
|
// } else {
|
||||||
// throw new Error(`Unknown message type ${msg.type}`);
|
// throw new Error(`Unknown message type ${msg.type}`);
|
||||||
// }
|
// }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user