Skip to content

Fix compliance findings in Frends.JSON.Validate (net8, analyzers, error handling) - #44

Draft
MichalFrends1 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-compliance-findings-again
Draft

Fix compliance findings in Frends.JSON.Validate (net8, analyzers, error handling)#44
MichalFrends1 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-compliance-findings-again

Conversation

Copilot AI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Resolves 5 Frends Task analyzer findings and upgrades the task to .NET 8, adding standard error-handling options in the process.

Changes

Compliance fixes

  • JSON class made static (FT0004)
  • CancellationToken parameter added to Validate() (FT0007)
  • Error property added to Result (FT0011)
  • ThrowErrorOnFailure and ErrorMessageOnFailure added to Options (FT0015 ×2)

Infrastructure

  • Both projects retargeted from net6.0net8.0
  • Version bumped 1.0.01.1.0

Error handling
Added Helpers/ErrorHandler.cs (standard pattern). Validate() now wraps all logic in a top-level try/catch:

catch (Exception ex)
{
    return ex.Handle(options); // respects ThrowErrorOnFailure / ErrorMessageOnFailure
}

The existing ThrowOnInvalidJson behaviour is preserved inside the inner try/catch.

Tests

  • Existing tests updated with CancellationToken.None
  • ErrorHandlerTests.cs added covering throw-on-failure, return-failed-result, and custom error message scenarios

Co-authored-by: MichalFrends1 <167774394+MichalFrends1@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compliance findings in Frends.JSON.Validate Fix compliance findings in Frends.JSON.Validate (net8, analyzers, error handling) Aug 5, 2026
Copilot AI requested a review from MichalFrends1 August 5, 2026 10:15
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