Skip to content

Handling the case when not 2xx response is desired #5280

Answered by baywet
adamvandenhoven asked this question in Q&A
Discussion options

You must be logged in to vote

how is that you're so consistently polite in these discussions?

🇨🇦🇨🇦🇨🇦🇨🇦

"is exception catching really the best/only way to deal with the situation where a 404 is the right response?

This is an opinionated decision we've made. In most languages dealing with an exception is more familiar to developers than monads or equivalent. And there's no way to tell a "good 400" from a "bad one" from the open API specification. So they should all be treated the same way.

which fails with Expected a <Company.Models.ProblemDetails> to be thrown, but found <Microsoft.Kiota.Abstractions.ApiException>

Assuming the description describes this problem detail, the client will throw a problem details inst…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@adamvandenhoven
Comment options

@baywet
Comment options

baywet Aug 30, 2024
Collaborator

Answer selected by adamvandenhoven
@adamvandenhoven
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants