fix: remove "Error when determining async func" (#12683)

- Add logs for debugging
This commit is contained in:
Rishabh Rathod 2022-04-12 15:32:02 +05:30 committed by GitHub
parent 76d9f2b9fc
commit 7626d75ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -95,7 +95,7 @@ export default class DataTreeEvaluator {
errors: EvalError[] = [];
resolvedFunctions: Record<string, any> = {};
currentJSCollectionState: Record<string, any> = {};
logs: any[] = [];
logs: unknown[] = [];
allActionValidationConfig?: { [actionId: string]: ActionValidationConfigMap };
public hasCyclicalDependency = false;
constructor(
@ -1076,6 +1076,7 @@ export default class DataTreeEvaluator {
action.value,
unEvalDataTree,
this.resolvedFunctions,
this.logs,
),
};
});

View File

@ -354,6 +354,7 @@ export function isFunctionAsync(
userFunction: unknown,
dataTree: DataTree,
resolvedFunctions: Record<string, any>,
logs: unknown[] = [],
) {
return (function() {
/**** Setting the eval context ****/
@ -415,7 +416,9 @@ export function isFunctionAsync(
}
}
} catch (e) {
console.error("Error when determining async function", e);
// We do not want to throw errors for internal operations, to users.
// logLevel should help us in debugging this.
logs.push({ error: "Error when determining async function" + e });
}
const isAsync = !!self.IS_ASYNC;
for (const entity in GLOBAL_DATA) {