Skip to content

Better diagnostics for duplicate headers#281

Open
Strepto wants to merge 2 commits into
masterfrom
nih/feat/scaff-header-diagnostics
Open

Better diagnostics for duplicate headers#281
Strepto wants to merge 2 commits into
masterfrom
nih/feat/scaff-header-diagnostics

Conversation

@Strepto

@Strepto Strepto commented Jun 12, 2025

Copy link
Copy Markdown
Collaborator

What have I made? 👩‍💻

Better diagnostics for duplicate headers in scaffolding data.

How can you best review this? 🧐

Is the output helpful?

Did I remember everything checklist?

  • I made some awesome changes! 😎
  • I left the code in a better state than when I started working on it ✨
  • I wrote unit and/or integration tests 👾
  • I have considered any security implications, and requested review of them explicitly 🔐
  • I verified that it checks the acceptance criteria. 📜
  • I have tested this change in the Echo DEV environment, or requested someone to test it for me 🚀
  • I updated the documentation/readme 📚
  • I made the PR title descriptive and human-readable 👨‍👩‍👦‍👦
  • Existing unreported issues I found but could not fix was added as a new Issues 🚧

@Strepto
Strepto requested review from Copilot and vero-so June 12, 2025 13:16

Copilot AI left a comment

Copy link
Copy Markdown

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 improves diagnostics for duplicate headers in scaffolding data by enhancing error handling and output messaging. The key changes include:

  • Introducing a try-catch block in the CSV conversion method to provide detailed diagnostics when duplicate headers are encountered.
  • Logging the duplicate header information and the full header row to the console.
  • Replacing hardcoded separator values with a dedicated constant.

}
catch (Exception e)
{
if (e.Message.Contains("Duplicate headers detected in HeaderPresent mode."))

Copilot AI Jun 12, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relying on substring matching of the exception message to detect duplicate headers can be fragile. Consider catching a more specific exception type if available or checking a dedicated error code.

Copilot uses AI. Check for mistakes.
if (e.Message.Contains("Duplicate headers detected in HeaderPresent mode."))
{
var headerRow = fileLines.First();
Console.WriteLine(

Copilot AI Jun 12, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Console.WriteLine for diagnostics in production code may not be the best choice. Consider using a structured logging framework to improve maintainability and traceability.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants