RPC Error handling and retries

The new RPC stuff is really great. One question I have is does the RPC calls handle retries? In my current RPC library I retry on these errors which are not uncommon:

const retryOn = new RegExp([
  'Network connection lost',
  'Cannot resolve Durable Object due to transient issue on remote node',
  'Durable Object reset because its code was updated',
  'The Durable Object\'s code has been updated',
].join('|'));

(from https://github.com/dabblewriter/durable-apis/blob/main/src/durable-apis.ts#L12-L17)

Usually 1 retry is all that is needed, though I do use exponential backoff to continue trying for up to several seconds. This is built-in to my RPC lib. It would be great if it were built-in to your implementation. I don't want to wrap every RPC call with a try/catch to retry on regular network/lifecycle errors.

Thanks!
Was this page helpful?