Closed guillaumechervetaxa closed 5 years ago
Definitely, the user should decide whether to they throw an exception or not.
Hello,
I open to discuss about it. But for me when server throw a status 400 or 500 the response have not the same format. It's why I throw an exception.
On HttpException on this case you have a property named content with the body on the server response.
@guillaumechervetaxa I thought about this feature I am working on it.
You can look at this implementation that look good => https://developer.mozilla.org/fr/docs/Web/API/Fetch_API/Using_Fetch
Your library will be more usable in functional/declarative way (all the language evolve in this way) when you will remove exception
@guillaumechervetaxa you can start to read what I start to implement in this PR =>#81. @malotho && @guillaumechervetaxa if you are ok with the implementation all client, I will add it the same logic for each request. :)
It's done in 1.7.0
Hi,
I think that this libraries should not through exception when http 400 code is returned. The status code is an information not a crash. It is the same for 500 status code. The response can contain useful information. The exception behavior intricate the code behind. It is the consumer choice to through an Exception or not and that depends of your needs.
What do you think about?
Regards,