# RetryOnAbort Method

## Overloads

| [RetryOnAbort<T>(Func<Task<T>>, Int32, Int32)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.RetryOnAbort.htm#Qlik_Engine_Communication_QlikConnection_RetryOnAbort__1_System_Func_System_Threading_Tasks_Task___0___System_Int32_System_Int32_) |  | Perform the request and retry if the operation is aborted due to a generic abort. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.RetryOnAbort.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.RetryOnAbort.htm)

## RetryOnAbort&lt;T&gt;(Func&lt;Task&lt;T&gt;&gt;, Int32, Int32)

Perform the request and retry if the operation is aborted due to a generic abort.

### Declaration

```

          public Task<T> RetryOnAbort<T>(Func<Task<T>> requestAsync, int attempts = 3, int delayMs = 50)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.Func&lt;System.Threading.Tasks.Task&lt;T&gt;&gt; | requestAsync | The request to perform. |
| System.Int32 | attempts | Maximum number of attempts before giving up. |
| System.Int32 | delayMs | Delay between attempts (in milliseconds). |

### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task&lt;T&gt; | The value returned by the request. |

### Type Parameters

| Name | Description |
| --- | --- |
| T | The return type of the operation. |

### Implements

[IQlikConnection.RetryOnAbort<T>(Func<Task<T>>, Int32, Int32)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.IQlikConnection.RetryOnAbort.htm#Qlik_Engine_Communication_IQlikConnection_RetryOnAbort__1_System_Func_System_Threading_Tasks_Task___0___System_Int32_System_Int32_)

### Examples

GenericObject o = myObject; var layout = o.Session.RetryOnAbort(o.GetLayoutAsync);