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

This commit is contained in:
Csaba Tuncsik 2024-05-29 14:57:01 +02:00 committed by GitHub
parent 6698179a69
commit f914c97d11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 115 additions and 3 deletions

View file

@ -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();
@ -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);

File diff suppressed because one or more lines are too long

View file

@ -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"
/>
@ -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 &&

View file

@ -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);