Hi guys! I'm trying to create a Feature that will ...
# ktor
a
Hi guys! I'm trying to create a Feature that will wrap the end result of the various parsing engines (JsonFeature etc...) to a custom Response class. What's the best way of doing it? e.g. I want to be able to do
httpClient.get<Result<MyApiResponseType>>(...)
and getting a result object that will contain its success/fail state, the exception etc.
b
(De)serialization is already a feature of ktor. Is there any reason why you're going to reinvent the wheel?
a
I don't need something for de-serialising data; what I do need is wrapping what I receive in a
Result
object. Result is a Sealed class that will Success if the response has been successful and Failure, containing the message of the failing response, in case the response code is not successful