kiota
kiota copied to clipboard
Override ApiException.Message getter to include ResponseStatusCode
See #4349; the default exception details are not very helpful.
This PR intends to add the ResponseStatusCode, property of the base ApiException, to the message when no primary message extension is used.
It's not great, the suggestion from the above issue to add the description from the spec is better, but this is (hopefully) an incremental improvement, relatively low impact, and may serve as an example for future improvements by pointing at the relevant code.
Considerations:
- it interpolates a new string for every call, but there's no easy way around that since
ResponseStatusCodeis mutable. - this could also be implemented in ApiException, but I think that would have higher impact and is less future proof: it's not in the path of fixing #4349.