Update ProxyResponse documentation to reference IForwarderErrorFeature
Issue Description
When users encounter a null ResponseTransformContext.ProxyResponse in a response transform, they currently don't have clear guidance on how to get more information about the error that occurred.
Changes
This PR adds documentation to the ResponseTransformContext.ProxyResponse property explaining how to access error details when the response is null:
- Added a using directive for
Yarp.ReverseProxy.Forwardernamespace to properly referenceIForwarderErrorFeature - Enhanced the XML documentation to recommend checking
HttpContext.Features.Get<IForwarderErrorFeature>()or usingHttpContextFeaturesExtensions.GetForwarderErrorFeature(HttpContext)to get details about the error
Before Change:
/// <summary>
/// The proxy response. This can be null if the destination did not respond.
/// </summary>
public HttpResponseMessage? ProxyResponse { get; init; }
After Change:
/// <summary>
/// The proxy response. This can be null if the destination did not respond.
/// When null, check <see cref="HttpContext.Features.Get{IForwarderErrorFeature}()"/>
/// or <see cref="HttpContextFeaturesExtensions.GetForwarderErrorFeature(HttpContext)"/>
/// for details about the error via the <see cref="IForwarderErrorFeature"/>.
/// </summary>
public HttpResponseMessage? ProxyResponse { get; init; }
This documentation improvement helps users discover how to access error information when handling null responses in response transforms.
Fixes #2562.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
dc.services.visualstudio.com
- Triggering command:
/home/REDACTED/work/yarp/yarp/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/yarp/yarp/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/yarp/yarp/artifacts/toolset/10.0.0-beta.25268.1.txt(dns block)pkgs.dev.azure.com
- Triggering command:
/home/REDACTED/work/yarp/yarp/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/yarp/yarp/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/yarp/yarp/artifacts/toolset/10.0.0-beta.25268.1.txt(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to my firewall allow list
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.