-
Notifications
You must be signed in to change notification settings - Fork 26
Bug: Exception Not Passed to Logger in Catch Block in WorkflowExecutionService #785
Copy link
Copy link
Closed
Copy link
Labels
C#C# related codeC# related codeMaintainabilitybugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C#C# related codeC# related codeMaintainabilitybugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed