zio-http
zio-http copied to clipboard
Server doesn't print unexpected error logs
Describe the bug The server doesn't print error logs when exceptions were thrown.
To Reproduce Scala 3:
import zio.http.*
import zio.{Scope, ZIO, ZIOAppArgs, ZIOAppDefault, ZLayer}
object Test extends ZIOAppDefault {
val app = Http.collectZIO[Request] { case Method.GET -> Root / "test" => throw RuntimeException("test error") }
override def run: ZIO[Any with ZIOAppArgs with Scope, Any, Any] = {
Server
.serve(app)
.provide(
ZLayer.succeed(Server.Config.default.enableRequestStreaming.port(8080)),
Server.live
)
}
}
When send a request to http://localhost:8080/test
, it responds empty body with 500 status code, and no error logs in server.
Expected behaviour It should print error logs in server.
/bounty $75
To fix and add a reproducer testcase.
💎 $75 bounty • ZIO
Steps to solve:
-
Start working: Comment
/attempt #2491
with your implementation plan -
Submit work: Create a pull request including
/claim #2491
in the PR body to claim the bounty - 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 bounty • Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
🟢 @cheikhsimsol | Jan 6, 2024, 10:26:44 PM | WIP |