Skip to content

Avoid throwing System.Exception when retrieving Infisical secrets #768

@ziagham

Description

@ziagham

What version of FlowSynx?

1.2.5

Describe the bug

File: src/FlowSynx.Infrastructure/Secrets/Infisical/InfisicalSecretProvider.cs
Line: 51

In the current implementation, a generic System.Exception is thrown when retrieving configuration secrets from Infisical fails:

throw new Exception(message, ex);

Throwing System.Exception directly in user code is considered bad practice because it is too generic, making exception handling and diagnostics harder.

Proposed Fix:

throw new InvalidOperationException(message, ex);

Benefits:

  • Provides a meaningful, specific exception for consumers.
  • Improves maintainability and readability of error handling.
  • Allows callers to catch specific exceptions instead of a generic System.Exception.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions