Skip to content

Fix FT0011/FT0014/FT0015/FT0017 compliance findings in Frends.HTTP.Request - #59

Open
MatteoDelOmbra with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-compliance-findings-frends-http-request
Open

Fix FT0011/FT0014/FT0015/FT0017 compliance findings in Frends.HTTP.Request#59
MatteoDelOmbra with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-compliance-findings-frends-http-request

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Resolves 7 task-analyzer findings in Frends.HTTP.Request: missing Success/Error on Result (FT0011), missing <example> tags on Header properties (FT0014), missing ThrowErrorOnFailure/ErrorMessageOnFailure on Options (FT0015), and third-party type exposure on CertificateStoreLocation (FT0017).

Changes

Definitions/

  • Header.cs — added <example> tags to Name and Value
  • Options.cs — added ThrowErrorOnFailure (default: true) and ErrorMessageOnFailure (default: "")
  • Result.cs — added Success and Error properties; consolidated the two success constructors into one internal Result(object body, …) + added internal Result(bool success, Error error) for failure case; failure constructor sets StatusCode = -1 as a sentinel
  • Error.cs (new)Message + AdditionalInfo properties

Helpers/ErrorHandler.cs (new)

Standard error-handler extension following the required platform pattern. Every exception in Request() now routes through it:

catch (Exception ex)
{
    return ex.Handle(options);
}

When ThrowErrorOnFailure = true (default) behavior is identical to before. When false, returns Result { Success = false, Error = { Message, AdditionalInfo } }.

Project / packaging

  • Frends.HTTP.Request.csproj: added StyleCop.Analyzers and FrendsTaskAnalyzers references; changed FrendsTaskMetadata.json from None to AdditionalFiles (required for FT0020 to pass)
  • Version bumped 1.12.0 → 1.13.0 (non-breaking additions)

Tests

  • ErrorHandlerTest.cs (new) — three NUnit tests covering throw-on-failure, return-result-on-failure, and custom error message, using an unreachable URL as the invalid-input trigger

Copilot AI and others added 2 commits August 17, 2026 10:09
…ends.HTTP.Request

Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
…value

Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compliance findings in Frends.HTTP.Request Fix FT0011/FT0014/FT0015/FT0017 compliance findings in Frends.HTTP.Request Aug 17, 2026
Copilot AI requested a review from MatteoDelOmbra August 17, 2026 10:14
/// Additional error information, such as the original exception.
/// </summary>
/// <example>null</example>
public object AdditionalInfo { get; internal set; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change type to Exception

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot fix this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done — changed AdditionalInfo type from object to Exception in Error.cs (commit $(git rev-parse --short HEAD)).

Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
@MatteoDelOmbra
MatteoDelOmbra marked this pull request as ready for review August 18, 2026 10:17
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