-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix: clean up error message duplication in bulk operation logs #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
FaultException<OrganizationServiceFault> errors were showing the same message 2-3 times in a single log line due to nested FaultDetail structure. When LogError(ex, ...) is called, the formatter uses ex.ToString() which includes the nested FaultDetail with repeated messages. Changes: - Add FormatCleanFaultMessage() to extract single clean message with error code - Log FaultException errors at Error level with clean single-line message - Full exception details available at Debug level for troubleshooting Before: "System.ServiceModel.FaultException`1[...]: Territory Does Not Exist (Fault Detail is equal to Exception details: ErrorCode: 0x80040217 Message: Territory Does Not Exist TimeStamp: ... -- Exception details: ErrorCode: ..." After: "CreateMultiple batch failed. Entity: territory, BatchSize: 10. Territory With Ids = 81b3de06... Does Not Exist (ErrorCode: 0x80040217)" Closes #276 Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary of ChangesHello @joshsmithxrm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the clarity and conciseness of error logging for bulk operations by eliminating redundant information from Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively addresses the issue of duplicated error messages in logs for FaultException<OrganizationServiceFault>. The introduction of the FormatCleanFaultMessage helper and the conditional logging logic is a clean solution. It improves log readability by providing a concise error message at the Error level, while still preserving the full exception details for debugging at the Debug level. The suggestion to use string.IsNullOrEmpty for more robust message formatting remains valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes duplicate error messages that appear in bulk operation logs when FaultException<OrganizationServiceFault> errors occur. The duplication stems from the nested FaultDetail structure in FaultException.ToString() which repeats the error message 2-3 times in a single log line.
Changes:
- Added
FormatCleanFaultMessage()helper method to extract and format clean, single-line error messages fromFaultException<OrganizationServiceFault> - Updated error logging to use clean formatted messages at Error level and full exception details at Debug level for troubleshooting
- Added comprehensive documentation explaining the rationale for the change
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/PPDS.Dataverse/BulkOperations/BulkOperationExecutor.cs | Added FormatCleanFaultMessage() helper and updated exception logging logic to provide clean error messages for FaultExceptions while preserving full details at Debug level |
| .claude/worker-plan.md | Added implementation plan documenting the problem, solution approach, and acceptance criteria mapping |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Please remove git rm .claude/worker-plan.md
git commit --amend --no-edit
git push --force-with-leasePR #324 adds this file to |
Address Gemini review feedback - use string.IsNullOrEmpty instead of null-coalescing operator to ensure we fall back to faultEx.Message if fault.Message is an empty string. Co-Authored-By: Claude Opus 4.5 <[email protected]>
b30c0a0 to
2717041
Compare
Summary
FormatCleanFaultMessage()helper to extract clean, single-line error message from FaultException{message} (ErrorCode: 0x{code:X8})FaultException<OrganizationServiceFault>.ToString()Before:
After:
Test plan
Closes #276
🤖 Generated with Claude Code