agoda-com / agoda-com/net-loadbalancing

Add resource parameter to `OnError` error handler

オープン
#41 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
C#
スター
25
フォーク
16
PR マージ指標
30日以内にマージされた PR はありません

説明

# 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
)
);
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。