Skip to content

Add resource parameter to OnError error handler #41

@marklagendijk

Description

@marklagendijk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions