feat(ui): handle enriched events

This commit is contained in:
psychedelicious
2024-05-23 15:21:01 +10:00
parent 1e622a5706
commit aa329ea811
4 changed files with 23 additions and 7 deletions

View File

@ -39,13 +39,21 @@ export const addInvocationErrorEventListener = (startAppListening: AppStartListe
actionCreator: socketInvocationError,
effect: (action, { getState }) => {
log.error(action.payload, `Invocation error (${action.payload.data.node.type})`);
const { source_node_id, error_type, graph_execution_state_id } = action.payload.data;
const { source_node_id, error_type, error_message, error_traceback, graph_execution_state_id } =
action.payload.data;
const nes = deepClone($nodeExecutionStates.get()[source_node_id]);
if (nes) {
nes.status = zNodeStatus.enum.FAILED;
nes.error = action.payload.data.error;
nes.progress = null;
nes.progressImage = null;
if (error_type && error_message && error_traceback) {
nes.error = {
error_type,
error_message,
error_traceback,
};
}
upsertExecutionState(nes.nodeId, nes);
}