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

ValidationApiException: Set ContentHeaders to value of encapsulated ApiException #1945

Open
fubar-coder opened this issue Jan 7, 2025 · 1 comment

Comments

@fubar-coder
Copy link

fubar-coder commented Jan 7, 2025

Is your feature request related to a problem? Please describe.

I'd like to use ValidationApiException, but I found no way to set the ContentHeaders property, which is inherited from ApiException.

Describe the solution you'd like

It would be useful, if ValidationApiException.Create sets the ContentHeaders property to the value of the ContentHeaders property from the ApiException passed to the Create function.

Describe alternatives you've considered

I'm currently using reflection, but that's not my preferred solution.

Describe suggestions on how to achieve the feature

  1. Change the setter of ApiException.ContentHeaders to protected
  2. Add ex.ContentHeaders = exception.ContentHeaders to the ValidationApiException.Create function

Additional context

  • Target framework: .NET 8.0/.NET Framework 4.7.2
  • Refit 8.0.0
@fubar-coder
Copy link
Author

I updated the issue, because it would be much better for the ContentHeaders setter to be protected, because that would also allow exceptions derived from ApiException to set this property.

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

No branches or pull requests

1 participant