Skip to content

Forceful sandboxing of handler in Route.handledIgnoreParams makes it impossible to do error introspection in Handler transformers. #3228

@notxcain

Description

@notxcain

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions