Skip to content

Commit

Permalink
TNO-3062 minor updates to the logs (#2283)
Browse files Browse the repository at this point in the history
- should re-throw exception after logging
  • Loading branch information
laidaoyu committed Sep 12, 2024
1 parent 73eea58 commit 2ad65bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/net/dal/Services/ProductService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ public void AddAndSave(UserProduct subscription)
} catch (Exception ex)
{
this.Logger.LogError(ex, $"ProductService - AddAndSave ProductId: {subscription.ProductId}, UserId: {subscription.UserId} throws exception.");
throw;
}
}

Expand All @@ -460,6 +461,7 @@ public void UpdateAndSave(UserProduct subscription)
} catch (Exception ex)
{
this.Logger.LogError(ex, $"ProductService - UpdateAndSave ProductId: {subscription.ProductId}, UserId: {subscription.UserId} throws exception.");
throw;
}
}

Expand Down Expand Up @@ -494,6 +496,7 @@ public UserProduct Unsubscribe(int userId, int productId)
} catch (Exception ex)
{
this.Logger.LogError(ex, $"ProductService - Unsubscribe userId: {userId}, productId: {productId} throws exception.");
throw;
}
return userProduct;
}
Expand Down Expand Up @@ -529,6 +532,7 @@ public UserProduct Subscribe(int userId, int productId)
} catch (Exception ex)
{
this.Logger.LogError(ex, $"ProductService - Subscribe userId: {userId}, productId: {productId} throws exception.");
throw;
}
return userProduct;
}
Expand Down
1 change: 1 addition & 0 deletions libs/net/dal/Services/ReportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,7 @@ public IEnumerable<long> GetRelatedReportInstanceContentToExclude(int reportId)
} catch (Exception ex)
{
this.Logger.LogError(ex, $"ReportService - ClearFoldersInReport Report Id: {report.Id} throws exception.");
throw;
}

return FindById(report.Id);
Expand Down
1 change: 1 addition & 0 deletions services/net/filemonitor/FilemonitorAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ private string FixBlacksNewsgroupXml(string filePath, string xml)
} catch (Exception ex)
{
this.Logger.LogError(ex, $"FixBlacksNewsgroupXml - process XML throws exceptions. The XML is: {xml}");
throw;
}
}

Expand Down

0 comments on commit 2ad65bf

Please sign in to comment.