Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Show execution error toast also if there is no error stack just message #9526

Merged
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
25 changes: 24 additions & 1 deletion cypress/e2e/20-workflow-executions.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { WorkflowPage } from '../pages';
import { WorkflowExecutionsTab } from '../pages/workflow-executions-tab';
import type { RouteHandler } from 'cypress/types/net-stubbing';
import executionOutOfMemoryServerResponse from '../fixtures/responses/execution-out-of-memory-server-response.json';

const workflowPage = new WorkflowPage();
const executionsTab = new WorkflowExecutionsTab();
Expand Down Expand Up @@ -72,7 +73,29 @@ describe('Current Workflow Executions', () => {
cy.url().should('not.include', '/executions');
});

it.only('should auto load more items if there is space and auto scroll', () => {
it('should error toast when server error message returned without stack trace', () => {
executionsTab.actions.createManualExecutions(1);
const message = 'Workflow did not finish, possible out-of-memory issue';
cy.intercept('GET', '/rest/executions/*', {
statusCode: 200,
body: executionOutOfMemoryServerResponse,
}).as('getExecution');

executionsTab.actions.switchToExecutionsTab();
cy.wait(['@getExecution']);

cy.getByTestId('workflow-preview-iframe')
.should('be.visible')
.its('0.contentDocument.body') // Access the body of the iframe document
.should('not.be.empty') // Ensure the body is not empty
.then(cy.wrap)
.find('.el-notification:has(.el-notification--error)')
.should('be.visible')
.filter(`:contains("${message}")`)
.should('be.visible');
});

it('should auto load more items if there is space and auto scroll', () => {
cy.viewport(1280, 960);
executionsTab.actions.createManualExecutions(24);

Expand Down

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion packages/editor-ui/src/components/WorkflowPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
[$style.openNDV]: nodeViewDetailsOpened,
[$style.show]: showPreview,
}"
:src="`${rootStore.baseUrl}workflows/demo`"
:src="iframeSrc"
data-test-id="workflow-preview-iframe"
@mouseenter="onMouseEnter"
@mouseleave="onMouseLeave"
/>
Expand Down Expand Up @@ -65,6 +66,10 @@ const insideIframe = ref(false);
const scrollX = ref(0);
const scrollY = ref(0);

const iframeSrc = computed(() => {
return `${window.BASE_PATH ?? '/'}workflows/demo`;
});

const showPreview = computed(() => {
return (
!props.loading &&
Expand Down
5 changes: 4 additions & 1 deletion packages/editor-ui/src/views/NodeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,10 @@ export default defineComponent({
}
}

if (!nodeErrorFound && data.data.resultData.error.stack) {
if (
!nodeErrorFound &&
(data.data.resultData.error.stack || data.data.resultData.error.message)
) {
// Display some more information for now in console to make debugging easier
console.error(`Execution ${executionId} error:`);
console.error(data.data.resultData.error.stack);
Expand Down
Loading