OpenAPITools / OpenAPITools/openapi-generator
[REQ] csharp-netcore apiclient policy result error message
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
When using a RetryPolicy if the outcome of the PolicyResult is unsuccessful, a RestResponse object where only the property ErrorException is populated. However in the subsequent code, this property is never accessed, only the property ErrorMessage is used.
Describe the solution you'd like
Replacing the line
ErrorException = policyResult.FinalException
by the line
ErrorMessage = policyResult.FinalException?.Message ?? policyResult.FinalHandledResult.ErrorMessage
or something alike would be great.
This occurs in two methods:
- private ApiResponse Exec
- private async Task<ApiResponse> ExecAsync
Additional context
This is a screenshot of the relevant code in the ApiClient.cs file.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ApiClient.cs and inspect the private Exec and ExecAsync methods where RetryPolicy results populate RestResponse. Ensure an unsuccessful policy result exposes the final exception or handled result through ErrorMessage in both methods, then verify the generated csharp-netcore client behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100