Skip to content

Bug: Exception Not Passed to Logger in Catch Block in WorkflowExecutionService #785

@ziagham

Description

@ziagham

What version of FlowSynx?

1.2.5

Describe the bug

The caught exception ex is not passed to the logger.
This results in missing stack trace information and makes troubleshooting significantly harder.
Logging in a catch block should always include the exception instance.

File: src/FlowSynx.Persistence/FlowSynx.Persistence.Postgres/Services/WorkflowExecutionService.cs
For Lines: 42, 64, 84, 105, 125, 146 change it

From (Current code)

_logger.LogError(errorMessage.ToString());

To (Proposed Fix)

_logger.LogError(ex, errorMessage.ToString());

and for Lines: 178, 200, 219 change them

From

_logger.LogError(ex.Message.ToString());

To (Proposed Fix)

_logger.LogError(ex, ex.Message.ToString());

Benefit

  • Preserves stack trace in logs
  • Improves diagnosability
  • Aligns with recommended logging practices for structured logging and exception tracking

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions