Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/frontend/editor-ui/src/app/stores/workflows.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1032,9 +1032,8 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
}

const storedPinData = payload.data.map((item) =>
isJsonKeyObject(item)
? { json: item.json, ...(item.binary && { binary: item.binary }) }
: { json: item },
// Store full item to preserve binary and paired item information
isJsonKeyObject(item) ? item : { json: item },
);

workflow.value.pinData[nodeName] = storedPinData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export abstract class ExecutionBaseError extends ApplicationError {
constructor(message: string, options: ExecutionBaseErrorOptions = {}) {
super(message, options);

this.name = this.constructor.name;
// Use Object.defineProperty to avoid "Cannot assign to read only property" error
Object.defineProperty(this, 'name', { value: this.constructor.name });
this.timestamp = Date.now();

const { cause, errorResponse } = options;
Expand Down
15 changes: 1 addition & 14 deletions packages/workflow/src/workflow-data-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,19 +794,6 @@ export class WorkflowDataProxy {
});
};

const createInvalidPairedItemError = ({ nodeName }: { nodeName: string }) => {
return createExpressionError("Can't get data for expression", {
messageTemplate: 'Expression info invalid',
functionality: 'pairedItem',
functionOverrides: {
message: "Can't get data",
},
nodeCause: nodeName,
descriptionKey: 'pairedItemInvalidInfo',
type: 'paired_item_invalid_info',
});
};

const createMissingPairedItemError = (
nodeCause: string,
usedMethodName: PairedItemMethod = PAIRED_ITEM_METHOD.PAIRED_ITEM,
Expand Down Expand Up @@ -962,7 +949,7 @@ export class WorkflowDataProxy {
// Done: reached the destination node in the ancestry chain
if (sourceData.previousNode === destinationNodeName) {
if (pairedItem.item >= outputData.length) {
throw createInvalidPairedItemError({ nodeName: sourceData.previousNode });
throw createMissingPairedItemError(sourceData.previousNode, usedMethodName);
}

return item;
Expand Down
5 changes: 3 additions & 2 deletions packages/workflow/test/workflow-data-proxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,9 @@ describe('WorkflowDataProxy', () => {
} catch (error) {
expect(error).toBeInstanceOf(ExpressionError);
const exprError = error as ExpressionError;
expect(exprError.message).toEqual("Can't get data for expression");
expect(exprError.context.type).toEqual('paired_item_invalid_info');
expect(exprError.message).toContain('Paired item data for item from node');
expect(exprError.message).toContain('Edit Fields');
expect(exprError.context.type).toEqual('paired_item_no_info');
}
});
});
Expand Down
Loading