Closed giogonzo closed 5 years ago
maybe we expose something that's easier to work with for clients, instead of an untagged union
Yes, my rationale here is: clients are interested in handling
1 & 2 are currently conflated into AxiosError
, at least until we don't agree upon a standard encoding of failures in metarpheus/fullstack - e.g. a solution would be wait for union types support then encode responses as HTTP 200 with an Either<AppError, Output>
body
3 is currently in this PR mainly because I wanted to discuss it, but for the reasons above I would remove it from the returned L
(and just throw at runtime), effectively leaving only AxiosError
for the moment.
we don't allow clients to decide how to unwrap the API response type anymore
This is completely unrelated, I just noticed we are not using this in projects anymore. But it should be moved to a sperate PR and released together in the same breaking version
3 is currently in this PR mainly because I wanted to discuss it, but for the reasons above I would remove it from the returned L (and just throw at runtime), effectively leaving only AxiosError for the moment.
👍 yeah, I would keep doing as we did before, and throw on failed decoding
This is completely unrelated, I just noticed we are not using this in projects anymore. But it should be moved to a sperate PR and released together in the same breaking version
👍 yep, although conflating this into this PR is not the end of the world
Closes [#2522358](https://buildo.kaiten.io/space/[object Object]/card/2522358)
⚠️ The line above was added during the automatic migration of all github project issues to Kaiten. The old GH issue link is kept here for reference (it is now deprecated, continue follow the original issue on Kaiten).
Closes #91
Test Plan
tested this at runtime on a project locally: https://github.com/buildo/getjenny/compare/test-metarpheus-taskeither
tests performed
tests not performed (domain coverage)