Skip to content

Commit

Permalink
Add step name or ID when there’s a NESTING_STEPS error
Browse files Browse the repository at this point in the history
Signed-off-by: Makara Sok <[email protected]>
  • Loading branch information
maktouch committed Apr 20, 2024
1 parent a639269 commit 1faf587
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/inngest/src/components/execution/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,9 @@ class V1InngestExecution extends InngestExecution implements IInngestExecution {
}): Promise<unknown> => {
await beforeExecHooksPromise;

const stepOptions = getStepOptions(args[0]);
const opId = matchOp(stepOptions, ...args.slice(1));

if (this.state.executingStep) {
/**
* If a step is found after asynchronous actions during another step's
Expand All @@ -765,7 +768,7 @@ class V1InngestExecution extends InngestExecution implements IInngestExecution {
*/
console.warn(
prettyError({
whatHappened: "We detected that you have nested `step.*` tooling.",
whatHappened: `We detected that you have nested \`step.*\` tooling in \`${opId.displayName ?? opId.id}\``,

Check warning on line 771 in packages/inngest/src/components/execution/v1.ts

View workflow job for this annotation

GitHub Actions / inngest: Lint

Replace `opId.displayName·??·opId.id}\``,·` with `⏎··············opId.displayName·??·opId.id⏎············}\``,`
consequences: "Nesting `step.*` tooling is not supported.",
type: "warn",
reassurance:
Expand All @@ -778,9 +781,6 @@ class V1InngestExecution extends InngestExecution implements IInngestExecution {
);
}

const stepOptions = getStepOptions(args[0]);
const opId = matchOp(stepOptions, ...args.slice(1));

if (this.state.steps[opId.id]) {
const originalId = opId.id;
maybeWarnOfParallelIndexing(originalId);
Expand Down

0 comments on commit 1faf587

Please sign in to comment.