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

The body of the error is not reachable through ApiException class #6023

Closed
melmi opened this issue Jan 15, 2025 · 2 comments
Closed

The body of the error is not reachable through ApiException class #6023

melmi opened this issue Jan 15, 2025 · 2 comments
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request

Comments

@melmi
Copy link

melmi commented Jan 15, 2025

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

Suppose a scenario in an API returns errors that are not documented in OpenAPI. In that case, Kiota throws an instance of ApiException. The problem is that there is no way to reach the body of the error message in this situation.
Based on documentation there is a message field in that class which is filled with a predefined message. That doesn't help at all.

Client library/SDK language

None

Describe the solution you'd like

I suggest having something like a content stream in that exception class so that I can access the server's response payload.

Additional context

No response

@melmi melmi added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels Jan 15, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Jan 15, 2025
@melmi
Copy link
Author

melmi commented Jan 15, 2025

might be a duplicate of this one:

#5167

@baywet
Copy link
Member

baywet commented Jan 15, 2025

Hi @melmi
Thank you for using kiota and for reaching out.

Closing as duplicate of #5167.

What you're looking for has been added in dotnet in microsoft/kiota-dotnet#482 and still needs to be implemented for other languages

@baywet baywet closed this as completed Jan 15, 2025
@github-project-automation github-project-automation bot moved this from Needs Triage 🔍 to Done ✔️ in Kiota Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request
Projects
Status: Done ✔️
Development

No branches or pull requests

2 participants