Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Retrying Upon Errors

Icon LinkRetrying upon errors

The default behavior of calls done via the Provider towards a fuel node is that they'll fail if the connection breaks. Specifying retry options allows you to customize how many additional attempts you want to make when the connection to the node breaks before ultimately throwing an error. You can also specify the back-off algorithm as well as the base delay that algorithm will use to calculate the wait time for each request.

const retryOptions: RetryOptions = {
  maxRetries: 5,
  baseDelay: 100,
  backoff: 'exponential',
};
 
const provider = await Provider.create(FUEL_NETWORK_URL, { retryOptions });