Effect CommunityEC
Effect Community2y ago
2 replies
Madyan

Implementing Middleware and Global Error Handling with `@effect/rpc`

With @effect/rpc is it possible to:
1- apply a middleware to a group of rpcs? (use case: 50% of my rpc should use an AdminAuthMiddleware, and 50% use GuestAuthMiddleware)
2- handle errors globally? (use case: most requests could throw SqlError, but if I don't catch it in every resolver it'd complain since the requests are defined with failure: Schema.Never)
Was this page helpful?