Skip to content

Commit

Permalink
Improve validation message on incompatible types in pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
georg-schwarz committed Jan 16, 2024
1 parent 7506f8f commit b43c379
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Validation of PipeDefinition', () => {
expect(validationAcceptorMock).toHaveBeenNthCalledWith(
2,
'error',
`The output type "File" of TestFileExtractor is incompatible with the input type "Table" of TestTableLoader`,
'The output type "File" of block "TestExtractor" (of type "TestFileExtractor") is not compatible with the input type "Table" of block "TestLoader" (of type "TestTableLoader")',
expect.any(Object),
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function checkBlockCompatibility(
}

if (!fromBlockType.canBeConnectedTo(toBlockType)) {
const errorMessage = `The output type "${fromBlockType.outputType}" of ${fromBlockType.type} is incompatible with the input type "${toBlockType.inputType}" of ${toBlockType.type}`;
const errorMessage = `The output type "${fromBlockType.outputType}" of block "${pipeWrapper.from?.name}" (of type "${fromBlockType.astNode.name}") is not compatible with the input type "${toBlockType.inputType}" of block "${pipeWrapper.to?.name}" (of type "${toBlockType.astNode.name}")`;
context.accept('error', errorMessage, pipeWrapper.getFromDiagnostic());
context.accept('error', errorMessage, pipeWrapper.getToDiagnostic());
}
Expand Down

0 comments on commit b43c379

Please sign in to comment.