mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(editor): Show execution error toast also if there is no error stack just message (#9526)
This commit is contained in:
parent
6698179a69
commit
f914c97d11
|
@ -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
|
@ -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 &&
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue