Skip to content

Commit

Permalink
feat(editor): Improve errors in output panel (#8644)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kret <michael.k@radency.com>
  • Loading branch information
gandreini and michael-radency authored Mar 7, 2024
1 parent 6e2aa40 commit 5301323
Show file tree
Hide file tree
Showing 38 changed files with 758 additions and 273 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { NodeOperationError, type IExecuteFunctions, type INodeExecutionData } from 'n8n-workflow';
import {
NodeOperationError,
type IExecuteFunctions,
type INodeExecutionData,
NodeApiError,
} from 'n8n-workflow';

import * as assistant from './assistant';
import * as audio from './audio';
Expand Down Expand Up @@ -54,6 +59,15 @@ export async function router(this: IExecuteFunctions) {
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
continue;
}

if (error instanceof NodeApiError) {
error.context = {
itemIndex: i,
};

throw error;
}

throw new NodeOperationError(this.getNode(), error, {
itemIndex: i,
description: error.description,
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/services/frontend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class FrontendService {
timezone: config.getEnv('generic.timezone'),
urlBaseWebhook: this.urlService.getWebhookBaseUrl(),
urlBaseEditor: instanceBaseUrl,
binaryDataMode: config.getEnv('binaryDataManager.mode'),
versionCli: '',
releaseChannel: config.getEnv('generic.releaseChannel'),
oauthCallbackUrls: {
Expand Down Expand Up @@ -308,6 +309,8 @@ export class FrontendService {

this.settings.executionMode = config.getEnv('executions.mode');

this.settings.binaryDataMode = config.getEnv('binaryDataManager.mode');

return this.settings;
}

Expand Down
2 changes: 2 additions & 0 deletions packages/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ export interface RootState {
urlBaseEditor: string;
instanceId: string;
isNpmAvailable: boolean;
binaryDataMode: string;
}

export interface NodeMetadataMap {
Expand Down Expand Up @@ -1154,6 +1155,7 @@ export interface IRootState {
nodeMetadata: NodeMetadataMap;
isNpmAvailable: boolean;
subworkflowExecutionError: Error | null;
binaryDataMode: string;
}

export interface CommunityPackageMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const defaultSettings: IN8nUISettings = {
banners: {
dismissed: [],
},
binaryDataMode: 'default',
};

export function routesForSettings(server: Server) {
Expand Down
1 change: 1 addition & 0 deletions packages/editor-ui/src/__tests__/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,5 @@ export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = {
saveDataErrorExecution: 'all',
saveDataSuccessExecution: 'all',
saveManualExecutions: false,
binaryDataMode: 'default',
};
Loading

0 comments on commit 5301323

Please sign in to comment.