Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource parameter to OnError error handler #41

Open
1 of 2 tasks
marklagendijk opened this issue Dec 8, 2022 · 0 comments
Open
1 of 2 tasks

Add resource parameter to OnError error handler #41

marklagendijk opened this issue Dec 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@marklagendijk
Copy link

Feature request

Type

  • - Enhancement - completely new feature
  • - 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.

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

Describe the solution you'd like

An extra resource parameter in OnError.
Example:

_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
    )
);
@marklagendijk marklagendijk added the enhancement New feature or request label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant