Describe the bug
Given the routes
val routes = Routes(
Method.POST / Root / "fail""-> Handler.fromZIO(ZIO.dieMessage("Defect"))
)
and a transformer
def logDefects[A](handle: Handler[A, Response, Request, Response]): Handler[A, Response, Request, Response] =
handler { (req: Request) =
handle(req).catchAllDefect { e =>
ZIO
.logErrorCause("Application defect", Cause.die(e))
.as(Response.internalServerError("Something went wrong"))
}
}
A POST /fail to routes.transform(logDefects) never logs the "Application defect" message.
Should sandboxing happen during the Server#install?