RetryConfig constructor

RetryConfig({
  1. required int maxAttempts,
  2. dynamic onExecute(
    1. RetryEvent event
    )?,
})

Returns the new instance of RetryConfig.

Implementation

RetryConfig({
  required this.maxAttempts,
  this.onExecute,
}) {
  if (maxAttempts < 0) {
    //! There is no use case where the number of retries is negative.
    throw ArgumentError.value(
      maxAttempts,
      'maxAttempts',
      'must be greater than or equal to 0',
    );
  }
}