-
Notifications
You must be signed in to change notification settings - Fork 412
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
Sandbox without absolving Throwables #2574
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2574 +/- ##
==========================================
- Coverage 64.37% 64.33% -0.04%
==========================================
Files 140 140
Lines 8315 8320 +5
Branches 1504 1515 +11
==========================================
Hits 5353 5353
- Misses 2962 2967 +5 ☔ View full report in Codecov by Sentry. |
I am not sure, this is a good idea. It seems confusing for me. The contract of zio-http error handling is, that we always return a response. One might not like the default behavior of sandbox, but there is iirc an even more hidden way, that I am not sure a user can always influence, if there is a defect. Can you elaborate on your use case and why the already existing ways to handle errors don't fit? |
Hi @987Nabil , sure. I totally get that this is not the standard usecase. and allowing the library to convert the throwable to a Response |
@yisraelU I think that @adamgfraser recently added a method that may help you out here. |
@yisraelU did you build this changes locally and check that they do want you want? Because seeing the code, I am not sure they do. I think we might do some defact to response logic deep in the guts of zio-http. That said, I am not sure, that map error throw is not good enough for your use case and we should rather keep a misleading or misbehaving orDie away from the user. Btw I can't test around my self, I am just checking from the phone 😉 |
@jdegoes nice. yes thats great |
@987Nabil No I didnt test locally. |
adds an orDie method to remove typed errors from Route and routes where the error is <:< Throwable