Skip to content

Improve Exception Logging in Plugin Download Extraction #551

@ziagham

Description

@ziagham

Summary

Currently, in the plugin download extraction process, the catch block logs errors like this:
File: src/FlowSynx.Infrastructure/PluginHost/Manager/PluginDownloader.cs line: 131

_logger.LogError(_localization.Get("Plugin_Download_Extraction_ErrorDuringDelete", ex.Message));

Problem:

Passing only ex.Message to the logger loses the full exception context, such as stack trace and inner exceptions. This makes debugging and troubleshooting harder.

Suggested Improvement:

The caught exception should be passed as a parameter to the logger to preserve full exception details:

_logger.LogError(ex, _localization.Get("Plugin_Download_Extraction_ErrorDuringDelete", ex.Message));

Benefits:

  • Full exception context (stack trace, inner exceptions) is preserved.
  • Easier debugging and monitoring.
  • Aligns with best practices for structured logging in .NET.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions