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

Decide using Endpoint codec in client based on status code #2727

Closed
987Nabil opened this issue Mar 13, 2024 · 4 comments · Fixed by #2929
Closed

Decide using Endpoint codec in client based on status code #2727

987Nabil opened this issue Mar 13, 2024 · 4 comments · Fixed by #2929
Labels

Comments

@987Nabil
Copy link
Contributor

987Nabil commented Mar 13, 2024

Currently this code in EndpointClient

      if (response.status.isSuccess) {
        endpoint.output.decodeResponse(response).orDie
      } else {
      //use error codec
      }

forces the error codec to be used for all status codes that are not 2xx/3xx.
This is an issue, since I as a user cannot decide that for example a 2xx is an error or a 4xx is not (means goes to E or A of the resulting ZIO).

We should choose the codec purely based on the mapping from returned status code to the codec with that status code.

@987Nabil 987Nabil added the enhancement New feature or request label Mar 13, 2024
@jdegoes
Copy link
Member

jdegoes commented Jun 5, 2024

/bounty $150

Copy link

algora-pbc bot commented Jun 5, 2024

💎 $150 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #2727 with your implementation plan
  2. Submit work: Create a pull request including /claim #2727 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @987Nabil #2929

Copy link

algora-pbc bot commented Jun 22, 2024

💡 @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Copy link

algora-pbc bot commented Jun 22, 2024

🎉🎈 @987Nabil has been awarded $150! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants