workflow
Version:
Workflow DevKit - Build durable, resilient, and observable workflows
45 lines (35 loc) • 926 B
text/mdx
title: FatalError
description: Throw to mark a step as permanently failed without retrying.
type: reference
summary: Throw FatalError in a step to mark it as permanently failed and prevent retries.
prerequisites:
- /docs/foundations/errors-and-retries
related:
- /docs/api-reference/workflow/retryable-error
When a `FatalError` is thrown in a step, it indicates that the workflow should not retry a step, marking it as failure.
You should use this when you don't want a specific step to retry.
```typescript lineNumbers
import { FatalError } from "workflow"
async function fallibleWorkflow() {
"use workflow"
await fallibleStep();
}
async function fallibleStep() {
"use step"
throw new FatalError("Fallible!") // [!code highlight]
}
```
## API Signature
### Parameters
<TSDoc
definition={`
interface Error {
/**
* The error message.
*/
message: string;
}
export default Error;`}
/>