inngest
Version:
Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.
1 lines • 1.43 kB
Source Map (JSON)
{"version":3,"file":"StepError.cjs","names":["stepId: string","jsonErrorSchema","deserializeError"],"sources":["../../src/components/StepError.ts"],"sourcesContent":["import { deserializeError } from \"../helpers/errors.ts\";\nimport { jsonErrorSchema } from \"../types.ts\";\n\n/**\n * An error that represents a step exhausting all retries and failing. This is\n * thrown by an Inngest step if it fails.\n *\n * It's synonymous with an `Error`, with the addition of the `stepId` that\n * failed.\n *\n * @public\n */\nexport class StepError extends Error {\n public override cause?: unknown;\n\n constructor(\n /**\n * The ID of the step that failed.\n */\n public readonly stepId: string,\n err: unknown,\n ) {\n const parsedErr = jsonErrorSchema.parse(err);\n\n super(parsedErr.message);\n this.name = parsedErr.name;\n this.stepId = stepId;\n\n // Don't show the internal stack trace if we don't have one.\n this.stack = parsedErr.stack ?? undefined;\n\n // Try setting the cause if we have one\n this.cause = parsedErr.cause\n ? deserializeError(parsedErr.cause, true)\n : undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,YAAb,cAA+B,MAAM;CACnC,AAAgB;CAEhB,YAIE,AAAgBA,QAChB,KACA;EACA,MAAM,YAAYC,8BAAgB,MAAM,IAAI;AAE5C,QAAM,UAAU,QAAQ;EALR;AAMhB,OAAK,OAAO,UAAU;AACtB,OAAK,SAAS;AAGd,OAAK,QAAQ,UAAU,SAAS;AAGhC,OAAK,QAAQ,UAAU,QACnBC,gCAAiB,UAAU,OAAO,KAAK,GACvC"}