Skip to content

Commit

Permalink
Merge pull request #2700 from cloudflare/cloudflare-workflows-module
Browse files Browse the repository at this point in the history
Fix types to correctly suggest NonRetryableError is exported in cloudflare:workflows
  • Loading branch information
sidharthachatterjee authored Sep 12, 2024
2 parents a05f580 + e5432c9 commit 529390d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions types/defines/workflows.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
* NonRetryableError allows for a user to throw a fatal error
* that makes a Workflow instance fail immediately without triggering a retry
*/
declare abstract class NonRetryableError extends Error {
/**
* `__brand` is used to differentiate between `NonRetryableError` and `Error`
* and is omitted from the constructor because users should not set it
*/
public constructor(message: string, name?: string);
declare module "cloudflare:workflows" {
export abstract class NonRetryableError extends Error {
/**
* `__brand` is used to differentiate between `NonRetryableError` and `Error`
* and is omitted from the constructor because users should not set it
*/
public constructor(message: string, name?: string);
}
}

declare abstract class Workflow {
Expand Down

0 comments on commit 529390d

Please sign in to comment.