-
Notifications
You must be signed in to change notification settings - Fork 76
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
[Http4s:middleware] pre and post error handling #877
Conversation
add error handling pre- and post-middleware
modules/http4s/src/smithy4s/http4s/internals/SmithyHttp4sServerEndpoint.scala
Outdated
Show resolved
Hide resolved
modules/http4s/src/smithy4s/http4s/ServerEndpointMiddleware.scala
Outdated
Show resolved
Hide resolved
Let's add additional tests too. |
Following some discussion around this, I've decided to wrap this pull request. I've added a test to make sure that if a user implements a middleware that can
Implemented it as such, it made more sense and it match the previous behavior |
When merging #877, I introduced a behaviour change that I had not anticipated: the errors defined in the smithy specs were turned into http response before users had a chance to react to them in the middleware they provide this is problematic and this fix reverts that
When merging #877, I introduced a behaviour change that I had not anticipated: the errors defined in the smithy specs were turned into http response before users had a chance to react to them in the middleware they provide this is problematic and this fix reverts that
I also added utility function for constructing middleware from partial function as I have seen often enough boilerplate to construct a middleware and the default being identity function , i figure this might be a bit cleaner