Skip to content

Commit

Permalink
fix: added try catch for error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
SB-harshitajadhav committed Aug 16, 2024
1 parent dc1a8ef commit 30337fe
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/core/src/runner/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,18 @@ function execute(input: unknown, callbacks: Record<string, Callback[]>, jsonPath
customShorthands: {},
});

nimma.query(
input,
Object.entries(callbacks).reduce<Record<string, Callback>>((mapped, [key, cbs]) => {
mapped[key] = scope => {
for (const cb of cbs) {
cb(scope);
}
};

return mapped;
}, {}),
);
try {
nimma.query(
input,
Object.entries(callbacks).reduce<Record<string, Callback>>((mapped, [key, cbs]) => {
mapped[key] = scope => {
for (const cb of cbs) {
cb(scope);
}
};
return mapped;
}, {}),
);
// eslint-disable-next-line no-empty
} catch (e) {}
}

0 comments on commit 30337fe

Please sign in to comment.