agoda-com / agoda-com/net-loadbalancing

Add resource parameter to `OnError` error handler

Đang mở
#41 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
C#
Star
25
Fork
16
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

# Feature request

## Type

- [ ] - Enhancement - completely new feature
- [x] - Improvement - make what we have better

## Is your feature request related to a problem?

Currently it is not possible to include information about the resource when logging errors in an `OnError` error handler of `ResourceManager.ExecuteAction`, because it only gets the `exception` and the `attemptCount`.

```c#
public delegate void OnError(Exception error, int attemptCount);
```

## Describe the solution you'd like

An extra `resource` parameter in `OnError`.
Example:
```c#
_resourceManager.ExecuteAction(
(serverOptions, _) => doSomething(serverOptions),
(attemptCount, _) => attemptCount <= 3,
(exception, attemptCount, serverOptions ) => _logger.LogError(
exception,
"Failed to connect to server {Host}:{Port}: {Message}",
serverOptions .Host, serverOptions .Port, exception.Message
)
);
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.