Skip to content

Commit

Permalink
fix(AWS Lambda Node): Fix "Invocation Type" > "Continue Workflow" (#3010
Browse files Browse the repository at this point in the history
)

* 🔨 fix for running in continue workflow

* ⚡ Minor simplification

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
  • Loading branch information
michael-radency and janober committed Mar 25, 2022
1 parent be40a3f commit 9547a08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/nodes-base/nodes/Aws/AwsLambda.node.ts
Expand Up @@ -6,6 +6,7 @@ import {
INodePropertyOptions,
INodeType,
INodeTypeDescription,
JsonObject,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
Expand Down Expand Up @@ -191,7 +192,7 @@ export class AwsLambda implements INodeType {
},
);

if (responseData !== null && responseData.errorMessage !== undefined) {
if (responseData !== null && responseData?.errorMessage !== undefined) {
let errorMessage = responseData.errorMessage;

if (responseData.stackTrace) {
Expand All @@ -206,7 +207,7 @@ export class AwsLambda implements INodeType {
}
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ error: error.message });
returnData.push({ error: (error as JsonObject).message });
continue;
}
throw error;
Expand Down

0 comments on commit 9547a08

Please sign in to comment.