Skip to content

Commit a7fd884

Browse files
author
denis.gladikov
committed
Remove sensitive data from component logs
1 parent a1a30ae commit a7fd884

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/actions/transform.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ const { JsonataTransform } = require('@elastic.io/component-commons-library');
88
* @param cfg configuration that is account information and configuration field values
99
*/
1010
async function processAction(msg, cfg) {
11-
const result = JsonataTransform.jsonataTransform(msg, cfg, this);
11+
let result;
12+
try {
13+
result = JsonataTransform.jsonataTransform(msg, cfg, this);
14+
} catch (e) {
15+
this.logger.error('Jsonata transformation failed!');
16+
this.logger.trace(`Jsonata transformation failed: ${e}`);
17+
throw new Error('Jsonata transformation failed!');
18+
}
1219
this.logger.info('Evaluation completed');
1320
if (result === undefined || result === null || Object.keys(result).length === 0) {
1421
return Promise.resolve();

0 commit comments

Comments
 (0)