You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Azure Core, RequestFailedException will not include the response content or headers in the message when the IsError property of the response is false.
Current solution:
we will ask customer to write customized RequestFailedDetailsParser and set it to Pipeline (customize the client constructor and re-build the pipeline with the customized RequestFailedDetailsParser).
Several DPG SDKs have adopt this solution.
Problem:
This is mgmt-plane SDK which use ArmClient which cannot be customized to accept RequestFailedDetailsParser.
And write customized code is heavy for customer.
Possible solution option:
And since more than one service required to retrieve the content of RequestFailedException, Azure.Core may be can provide an API to construct the Pipeline with cutsomized parser (just like pipeline policy) when create client just like pipeline policy
There will be an optional field RequestFailedDetailsParser? RequestFailedDetailsParser in ClientOptions. When build pipeline, it will set the requestFailedDetailsParser to pipeline.
public abstract class ClientOptions
{
...
public RequestFailedDetailsParser ? RequestFailedDetailsParser { get; set; }
...
}
When customer want to retrieve content from RequestFailedException, they can write their own RequestFailedDetailsParser and set to ClientOptions when create client.
The text was updated successfully, but these errors were encountered:
@chunyu3 : I don't follow the scenario here. We intentionally do not include the content or headers when IsError is not set to avoid leaking potentially sensitive information. Please explain the full end-to-end scenario of the use case and why accessing the raw response is not adequate. Further, please provide details on why ArmClient cannot use the existing Core API to manage the parser.
This feature ask is related to #45220 (comment) , if customer want to have the details of the response then they can specify the RequestFailedDetailsParser when constructing the RequestFailedException.
In Azure Core,
RequestFailedException
will not include the response content or headers in the message when theIsError
property of the response isfalse
.azure-sdk-for-net/sdk/core/Azure.Core/CHANGELOG.md
Line 84 in 8f5cf84
We received a request in
Language-Dotnet
channel, they want to see the error message fromRequestFailedException
https://teams.microsoft.com/l/message/19:[email protected]/1734990642330?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&parentMessageId=1734990642330&teamName=Azure%20SDK&channelName=Language%20-%20DotNet&createdTime=1734990642330
Current solution:
we will ask customer to write customized
RequestFailedDetailsParser
and set it toPipeline
(customize the client constructor and re-build the pipeline with the customizedRequestFailedDetailsParser
).Several DPG SDKs have adopt this solution.
Problem:
This is mgmt-plane SDK which use
ArmClient
which cannot be customized to acceptRequestFailedDetailsParser
.And write customized code is heavy for customer.
Possible solution option:
And since more than one service required to retrieve the content of
RequestFailedException
, Azure.Core may be can provide an API to construct the Pipeline with cutsomized parser (just like pipeline policy) when create client just likepipeline policy
There will be an optional field
RequestFailedDetailsParser? RequestFailedDetailsParser
inClientOptions
. When build pipeline, it will set therequestFailedDetailsParser
to pipeline.When customer want to retrieve content from
RequestFailedException
, they can write their ownRequestFailedDetailsParser
and set toClientOptions
when create client.The text was updated successfully, but these errors were encountered: