Skip to content

Conversation

@koen-lee
Copy link

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 ResponseStatusCode is 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 Take exception message from OpenAPI document #4349.

@koen-lee koen-lee requested a review from a team as a code owner September 24, 2025 10:34
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

We'll need to coordinate this change across languages to provide a consistent experience. Can you please update the other languages?

@koen-lee
Copy link
Author

@baywet I'm only qualified to write/judge C# code, but if it's OK to have Claude and Copilot to write that code and you trust the unit tests and your own due process, I'll include other languages.

@koen-lee
Copy link
Author

@microsoft-github-policy-service agree company="Logiqs"

@koen-lee koen-lee requested a review from baywet September 25, 2025 11:09
@baywet
Copy link
Member

baywet commented Oct 3, 2025

just for context I'm holding review until we merge #6953 since I believe those PRs will conflict a lot with each other.
Let me know if you have any additional comments or questions.

@koen-lee koen-lee force-pushed the Show-HTTP-status-in-ApiException-Message branch from 3d82525 to 8d55c2b Compare October 3, 2025 16:07
@koen-lee
Copy link
Author

koen-lee commented Oct 3, 2025

@baywet #6953 and this are independent - at least they are now that I have removed the errorcode key from the description in that PR.

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

Successfully merging this pull request may close these issues.

2 participants