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

Make Response.IsError functional for clients #24247

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

annelo-msft
Copy link
Member

@annelo-msft annelo-msft commented Sep 27, 2021

Missed this in the last IsError PR. Fixes #24225

As long as Response.IsError lives in Azure.Core.Experimental, we'll need to add the ResponsePropertiesPolicy to LLC clients' pipelines in their constructors, as we're doing here. When this functionality moves into Azure.Core, we can add this to PipelineBuilder.

@pakrym
Copy link
Contributor

pakrym commented Sep 27, 2021

Test?

@annelo-msft
Copy link
Member Author

Test?

CanGetOutputModelOnSuccessCodeAsync was failing before this fix with the following exception:

Message:
System.InvalidOperationException : IsError was not set on the response. Please ensure the pipeline includes ResponsePropertiesPolicy.

@pakrym
Copy link
Contributor

pakrym commented Sep 27, 2021

Do we have a test for the error scenario?

@annelo-msft
Copy link
Member Author

Do we have a test for the error scenario?

CannotGetOutputModelOnFailureCodeAsync is intended to do this, but is there a case you're thinking of that's not covered here? Happy to add...

@pakrym
Copy link
Contributor

pakrym commented Sep 27, 2021

That test throws inside the client. Do we have one that throws in the cast operator?

@annelo-msft annelo-msft enabled auto-merge (squash) September 27, 2021 16:56
@annelo-msft annelo-msft merged commit f1f4cb9 into Azure:main Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LLC] Make Response.IsError work on LLC clients
2 participants