Skip to content

Commit d98c5fb

Browse files
committed
log errorNode when node fails to process
1 parent e85f159 commit d98c5fb

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

packages/flowtest-cli/graph/Graph.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,21 @@ class Graph {
206206
}
207207
} catch (err) {
208208
console.log(chalk.red(`Flow failed at: ${JSON.stringify(node.data)} due to ${err}`));
209-
this.logger.add(LogLevel.ERROR, `Flow failed due to ${err}`, node);
209+
this.logger.add(LogLevel.ERROR, `Flow failed due to ${err}`, {
210+
type: 'errorNode',
211+
data: node.data,
212+
});
210213
return {
211214
status: 'Failed',
212215
};
213216
}
214217

215218
if (result === undefined) {
216219
console.log(chalk.red(`Flow failed due to failure to evaluate result at node: ${node.data}`));
217-
this.logger.add(LogLevel.ERROR, 'Flow failed due to failure to evaluate result', node);
220+
this.logger.add(LogLevel.ERROR, 'Flow failed due to failure to evaluate result', {
221+
type: 'errorNode',
222+
data: node.data,
223+
});
218224
return {
219225
status: 'Failed',
220226
};

src/components/molecules/flow/graph/Graph.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,20 @@ class Graph {
183183
throw Error(`Timeout of ${this.timeout} ms exceeded, stopping graph run`);
184184
}
185185
} catch (err) {
186-
this.logger.add(LogLevel.ERROR, `Flow failed due to ${err}`, node);
186+
this.logger.add(LogLevel.ERROR, `Flow failed due to ${err}`, {
187+
type: 'errorNode',
188+
data: node.data,
189+
});
187190
return {
188191
status: 'Failed',
189192
};
190193
}
191194

192195
if (result === undefined) {
193-
this.logger.add(LogLevel.ERROR, 'Flow failed due to failure to evaluate result', node);
196+
this.logger.add(LogLevel.ERROR, 'Flow failed due to failure to evaluate result', {
197+
type: 'errorNode',
198+
data: node.data,
199+
});
194200
return {
195201
status: 'Failed',
196202
};

0 commit comments

Comments
 (0)