cloudflare / cloudflare/workerd
Missing type for Durable Object errors
Open
Durable Objects
types
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
Errors thrown by Durable Object stubs can include retryable and overloaded properties, as documented in the
https://developers.cloudflare.com/durable-objects/best-practices/error-handling/. However, there's no exported TypeScript type for this in the generated runtime types or @cloudflare/workers-types.
Currently everyone has to define their own type:
```ts
interface DurableObjectError extends Error {
retryable?: boolean;
overloaded?: boolean;
}
```
It would be nice to have an official type shipped with the runtime types so error handling can be done in a type-safe way without custom definitions.
Contributor guide
Assessment
This issue has not been assessed yet.