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

Error handling methods on Route/Routes that can access Request #2546

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

987Nabil
Copy link
Contributor

@987Nabil 987Nabil commented Dec 6, 2023

Bug fix on Warning header

@987Nabil 987Nabil force-pushed the error-handling-with-request-access branch 3 times, most recently from 743e301 to ea5e790 Compare December 7, 2023 06:40
@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (58e0594) 64.28% compared to head (43da2dd) 64.27%.
Report is 2 commits behind head on main.

Files Patch % Lines
zio-http/src/main/scala/zio/http/Route.scala 72.41% 8 Missing ⚠️
zio-http/src/main/scala/zio/http/Routes.scala 0.00% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2546      +/-   ##
==========================================
- Coverage   64.28%   64.27%   -0.02%     
==========================================
  Files         138      138              
  Lines        7977     8013      +36     
  Branches     1483     1457      -26     
==========================================
+ Hits         5128     5150      +22     
- Misses       2849     2863      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@987Nabil 987Nabil force-pushed the error-handling-with-request-access branch from ea5e790 to d6dbc78 Compare December 7, 2023 06:59
* used to convert a route that does not handle its errors into one that does
* handle its errors.
*/
final def handleErrorRequest(f: (Err, Request) => Response)(implicit trace: Trace): Route[Env, Nothing] =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One can argue that handleError with Request could be useful in non-cause scenarios, which would argue for the naming convention of handleError[Request][Cause].

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleError[Request][Cause][ZIO]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdegoes done

@987Nabil 987Nabil force-pushed the error-handling-with-request-access branch from d6dbc78 to 43da2dd Compare December 8, 2023 08:02
@jdegoes jdegoes merged commit e3e3ab1 into zio:main Dec 8, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants