Improve information for cyclic dependency error (#5949)
This commit is contained in:
parent
745927ffef
commit
7063ee9d2d
|
|
@ -177,7 +177,7 @@ export function* evalErrorHandler(
|
|||
case EvalErrorTypes.CYCLICAL_DEPENDENCY_ERROR: {
|
||||
if (error.context) {
|
||||
// Add more info about node for the toast
|
||||
const { entityType, node } = error.context;
|
||||
const { dependencyMap, diffs, entityType, node } = error.context;
|
||||
Toaster.show({
|
||||
text: `${error.message} Node was: ${node}`,
|
||||
variant: Variant.danger,
|
||||
|
|
@ -191,6 +191,10 @@ export function* evalErrorHandler(
|
|||
node,
|
||||
entityType,
|
||||
},
|
||||
extra: {
|
||||
dependencyMap,
|
||||
diffs,
|
||||
},
|
||||
// Level is warning because it could be a user error
|
||||
level: Sentry.Severity.Warning,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import {
|
|||
addErrorToEntityProperty,
|
||||
convertPathToString,
|
||||
CrashingError,
|
||||
DataTreeDiff,
|
||||
DataTreeDiffEvent,
|
||||
getAllPaths,
|
||||
getEntityNameAndPropertyPath,
|
||||
|
|
@ -483,7 +484,10 @@ export default class DataTreeEvaluator {
|
|||
}
|
||||
}
|
||||
|
||||
sortDependencies(dependencyMap: DependencyMap): Array<string> {
|
||||
sortDependencies(
|
||||
dependencyMap: DependencyMap,
|
||||
diffs?: (DataTreeDiff | DataTreeDiff[])[],
|
||||
): Array<string> {
|
||||
const dependencyTree: Array<[string, string]> = [];
|
||||
Object.keys(dependencyMap).forEach((key: string) => {
|
||||
if (dependencyMap[key].length) {
|
||||
|
|
@ -519,6 +523,8 @@ export default class DataTreeEvaluator {
|
|||
context: {
|
||||
node,
|
||||
entityType,
|
||||
dependencyMap,
|
||||
diffs,
|
||||
},
|
||||
});
|
||||
console.error("CYCLICAL DEPENDENCY MAP", dependencyMap);
|
||||
|
|
@ -949,7 +955,10 @@ export default class DataTreeEvaluator {
|
|||
// global inverse dependency map
|
||||
if (didUpdateDependencyMap) {
|
||||
// This is being called purely to test for new circular dependencies that might have been added
|
||||
this.sortedDependencies = this.sortDependencies(this.dependencyMap);
|
||||
this.sortedDependencies = this.sortDependencies(
|
||||
this.dependencyMap,
|
||||
translatedDiffs,
|
||||
);
|
||||
this.inverseDependencyMap = this.getInverseDependencyTree();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export enum DataTreeDiffEvent {
|
|||
NOOP = "NOOP",
|
||||
}
|
||||
|
||||
type DataTreeDiff = {
|
||||
export type DataTreeDiff = {
|
||||
payload: {
|
||||
propertyPath: string;
|
||||
value?: string;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user