Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] HLC + DPG + Exceptions? #27614

Closed
tg-msft opened this issue Mar 17, 2022 · 1 comment
Closed

[BUG] HLC + DPG + Exceptions? #27614

tg-msft opened this issue Mar 17, 2022 · 1 comment
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. DPG
Milestone

Comments

@tg-msft
Copy link
Member

tg-msft commented Mar 17, 2022

I’m having a problem trying to use DPG via HLC around exceptions:

If I’m surfacing this to Storage customers, it won’t populate the RequestFailedException.ErrorCode, it won’t use the additionalInfo for a great exception message, etc. Not having ErrorCode in particular is a deal breaker.

I think this also breaks the DPG "don't throw" story because I'll get different exceptions if the client throws vs. if I do myself.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 17, 2022
@tg-msft tg-msft added Client This issue points to a problem in the data-plane of the library. Azure.Core DPG labels Mar 17, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 17, 2022
@azure-sdk azure-sdk added needs-team-triage Workflow: This issue needs the team to triage. Storage Storage Service (Queues, Blobs, Files) labels Mar 17, 2022
@tg-msft tg-msft removed the Storage Storage Service (Queues, Blobs, Files) label Mar 17, 2022
@jsquire jsquire removed the needs-team-triage Workflow: This issue needs the team to triage. label Mar 17, 2022
@annelo-msft annelo-msft self-assigned this Mar 18, 2022
@christothes christothes added this to the [2022] May milestone Mar 28, 2022
@annelo-msft annelo-msft modified the milestones: [2022] May, [2022] June Apr 1, 2022
@jsquire jsquire modified the milestones: [2022] June, [2022] July Jun 14, 2022
@jsquire jsquire modified the milestones: 2022-07, 2022-08 Jul 15, 2022
@jsquire jsquire modified the milestones: 2022-08, Backlog Sep 6, 2022
@tg-msft
Copy link
Member Author

tg-msft commented Jun 21, 2023

Closing as this no longer repros:

using Azure;
using Azure.Storage;
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Specialized;

BlobClient blob = new(new Uri("..."), new StorageSharedKeyCredential("...", "..."));
BlobLeaseClient lease = blob.GetBlobLeaseClient();

try
{
    await lease.AcquireAsync(TimeSpan.FromHours(3));
}
catch (RequestFailedException ex)
{
    Console.WriteLine($"Convenience: {ex}");
}

try
{
    await lease.AcquireAsync(TimeSpan.FromHours(3), conditions: null, new RequestContext());
}
catch (RequestFailedException ex)
{
    Console.WriteLine($"Protocol: {ex}");
}

try
{
    RequestContext ctx = new();
    ctx.AddClassifier(400, isError: false);
    Response raw = await lease.AcquireAsync(TimeSpan.FromHours(3), conditions: null, ctx);
    throw new RequestFailedException(raw);
}
catch (RequestFailedException ex)
{
    Console.WriteLine($"Classified then thrown: {ex}");
}

@tg-msft tg-msft closed this as completed Jun 21, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. DPG
Projects
None yet
Development

No branches or pull requests

5 participants