Derock
Explore posts from serversis it possible to send error codes that aren't listed (eg 503 - service unavailable)
When creating a
TRPCError
you can specify a code out of the ones listed on the docs
But out of these, the only 5xx error is internal server error. I would like to send a 503 to indicate that the request was properly formatted, but the server isn't ready to handle it yet. It's not necessarily a server error.2 replies
Is it possible to only use WebSockets when necessary, otherwise use httpbatch or http?
I have an application, and on certain pages I need live data. Is there a way to only have tRPC open a websocket for subscriptions and then use another link otherwise?
I would like for the solution to disconnect from WS when all subscriptions have been ended, so no dangling WS connections.
15 replies
How to set cookies in trpc response?
I have an app dir project that was created using this t3-app PR.
On the client I have a form and I am using the trpc react client:
and I have the following route defined:
This does not set the cookie though -- no
Set-Cookie
header is in the response.
I have no idea how to access the response manually to add the header in either.11 replies