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

Remove route builder #3115

Merged
merged 2 commits into from
Sep 9, 2024
Merged

Remove route builder #3115

merged 2 commits into from
Sep 9, 2024

Conversation

987Nabil
Copy link
Contributor

@987Nabil 987Nabil commented Sep 9, 2024

fixes #2870
/claim #2870

@987Nabil 987Nabil force-pushed the remove-route-builder branch from 8bf9ae7 to f064483 Compare September 9, 2024 20:26
@jdegoes
Copy link
Member

jdegoes commented Sep 9, 2024

@987Nabil You referenced the wrong ticket?

@987Nabil
Copy link
Contributor Author

987Nabil commented Sep 9, 2024

I removed the route builder, since it is not needed anymore. Also I enabled Env access for the zio effects that handle errors on Route/Routes

@987Nabil
Copy link
Contributor Author

987Nabil commented Sep 9, 2024

@jdegoes it fixes both

@@ -53,7 +53,9 @@ sealed trait Route[-Env, +Err] { self =>
final def handleError(f: Err => Response)(implicit trace: Trace): Route[Env, Nothing] =
self.handleErrorCauseZIO(c => ErrorResponseConfig.configRef.get.map(Response.fromCauseWith(c, _)(f)))

final def handleErrorZIO(f: Err => ZIO[Any, Nothing, Response])(implicit trace: Trace): Route[Env, Nothing] =
final def handleErrorZIO[Env1 <: Env](
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Env access

final def handleErrorCauseZIO(
f: Cause[Err] => ZIO[Any, Nothing, Response],
)(implicit trace: Trace): Route[Env, Nothing] =
final def handleErrorCauseZIO[Env1 <: Env](
Copy link
Contributor Author

Choose a reason for hiding this comment

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

env access

@jdegoes jdegoes merged commit b900d12 into zio:main Sep 9, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add access to Env in error handler
2 participants